Android is an operating system for mobile devices developed and maintained by Google, Inc. This tag should contain specific programming questions about Android.

learn more… | top users | synonyms

1
vote
1answer
54 views

android game change background image at every level?

I want to be able to have a different background image at each level of my game. Presently I have only one. There is no layout folder shown in Android Studio and all info I have searched shows how to ...
0
votes
0answers
15 views

Libgdx Music is not working again

I am starting background music when the user goes to the PlayScreen and when the kid in the game dies, the background music stops and starts game over music and move to game over screen, then the user ...
2
votes
0answers
17 views

Porting to Android…what is the equivalent of Properties.Settings.Default?

I'm porting my MonoGame/OpenGL app to Android. My game uses Properties.Settings.Default to store user preferences. What is the equivalent of this in Android?
1
vote
1answer
40 views

Libgdx Scene2D Table background not whowing up

I am using Libgdx's Scene2D API to build by UI and everything has been working as expected until now. I created a Skin and a TextureAtlas and linked them as so: Skin skin = new Skin(); TextureAtlas ...
0
votes
0answers
17 views

Libgdx Ending level is not working properly

In my game the kid is collecting fruits but if he hits the rock 3 times or time is up before collecting the required points, the kid will jump to the half of the screen then fall down and start fail ...
1
vote
0answers
56 views

Export UnityProject inside Android Studio's existing project

I am new to the Unity3D, but I have made a small Unity project with a humanoid gameobject. I can move this humanoid with the demo data but I want to move it with the quaternion data which I am already ...
1
vote
2answers
47 views

Textures are not drawn separatley

I am trying to draw different textures of balloons and I want them to appear in different times about half second between each one, and move in the world. first balloons are rendered but after about ...
2
votes
1answer
44 views

Libgdx Image doesn't fit the Screen

I am Trying to show Image as background, but it doesn't fit to the screen. When I use this class as the start screen it fit the screen properly but when I call this class after winning the level, the ...
1
vote
1answer
61 views

Check collision between two rectangles - libGDX

I'm making a game in which the objective is to collect the maximum amount of balls(Rectangle) to get the highest score. The balls spawn randomly from the middle of every side of your smartphone, and ...
0
votes
0answers
26 views

Two Viewpagers - swipe from one to another cause stuck

I have two Viewpagers, one is controlling whole layouts (pages), and second holds some items. First one is named viewPager1 in this image: Works good, but not perfect; As you can see, there's ...
0
votes
0answers
15 views

Coordinate code for moving the object from one side to others side

I'm trying to make a 2D games, like airplane in android. To play the airplane, the user must shake the phone and then the airplane will move from left side to right side. And I don't know how to move ...
0
votes
2answers
46 views

Black lines on sprites

I am having the issue as seen below while using a textureAtlas with libgdx. I haven't found anyone else with the issue so I decided to ask here. Here is an image of the textures in the game screen: ...
1
vote
2answers
49 views

Libgdx Back button exit the app

when I press back button on android, it exits the game although I ask it to go to other screen instead. It goes to the other screen for one or two seconds then it exits.: if((Gdx.input.isKeyPressed(...
0
votes
0answers
26 views

How to program light effects in Andengine

I'm trying to make some light effects to my game, but for now i failed to do it well, i try put 3 Sprites: bitmap1 = new BitmapTextureAtlas(getTextureManager(), 1400, 1400, TextureOptions.DEFAULT); ...
1
vote
0answers
52 views

Mobile game without game engine [closed]

I am planning on making a 2D mobile game for iOS and Android. It will have animations (including some simple flash/light and particle effects, like in Candy Crush), but the only physics the game will ...
0
votes
0answers
11 views

libgdx : starting animation disables imagebutton

I am playing an animation on clicking an imagebutton in android. Both the imagebutton and the Image for animation are actors on same stage. Animation plays perfectly, but the issue is after the ...
1
vote
1answer
40 views

LibGDx android : Show animation on button click

I am trying to create an application using libgdx where i need an animation to be played on pressing an image button, i've been able to achieve it using this code if(slapBossFlag==true) { ...
0
votes
2answers
104 views

Android game to iOS, go with an engine?

I have developed a game on android using native coding. However I am being asked to port it to ios. So I thought that I should bite the bullet and recode it in unity so I can go cross platform. I ...
1
vote
0answers
73 views

How should I structure a Shared Library for different platforms for my MonoGame project?

I am quite new to the MonoGame/XNA framework and i have some structuring questions right now. One of the reasons I use MonoGame is because there is still that feeling to create a game from scratch ...
0
votes
0answers
41 views

How to use touch.deltaPosition properly?

I use following code for measure touch delata position: private Touch firstDetectedTouch; public Vector3 dragDistance; void Update() { if (Input.touchCount > 0) { ...
0
votes
0answers
32 views

Libgdx game doesn't work correctly after game over screen

So, I am trying to create a platform game for Android. As part of the game, I have created ladders that the hero is climbing. When he hits the enemy he dies, there is a game over screen --> touch to ...
0
votes
0answers
42 views

Admob banner causes lag while playing Android Libgdx game

I hide banner ads while playing and show on game over screen but while playing game lags. If I disable ads then there is no lag. Or if I connect to wi-fi, again no lag, but with mobile data it lags. ...
1
vote
2answers
83 views

How to use touch screen for movement instead of keyboard narrow keys

I wrote this code and run the game on my desktop, now I need to build this game for android and I need to change to touch to move the player, what it should be changed in the following code and what ...
0
votes
1answer
41 views

Is there any difference between the reading of sensors in Unity5 and Android/Java?

I'm an Android/Java developer, and I'm new to unity5. I have a program written in Android/Java that uses the readings of three sensors( Accelerometer, Magnetometer and LinearAccelertion ). I'm now ...
1
vote
2answers
41 views

Should I use one GLSurfaceView.Renderer for each part of my game?

I am creating a small platformer-like game for Android using OpenGL. The game has 3 main screens/states: Main menu screen Level selection screen The game screen Currently I use a GLSurfaceView....
0
votes
0answers
23 views

HTML5 game - Difference in layouts in webview of app and webpage

I have created a working prototype of an HTML5 game and tried to convert it into an android app using PhoneGap. My issue is that the layout of the screen is bigger in case of the webview of the app. ...
0
votes
0answers
31 views

Paint objects cause lower FPS by time

I'm creating squares on XML layout with Paint, you can see how exactly bellow: public class PaintObject extends View { Paint paint; public int x; public int y; public PaintObject(...
0
votes
1answer
28 views

LibGDX Rotate 2D image with touchDragged() event

Objective: to rotate an image in the center of the screen with movement equal to left or right touchDragged event. Right now I have a basic Stage that is created and adds an actor (centerMass.png) ...
0
votes
0answers
36 views

Removing no longer used paint out of screen

I have Paint, like this: Paint paint = new Paint(); paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.FILL); paint.setStrokeWidth(5); paint.setColor(Color.BLUE); and I'm drawing ...
0
votes
0answers
49 views

LibGDX works well on android 4 and very bad on android 5 and 6

I have a problem with my game. The game is made with libgdx, scene2d and box2d and it uses an AssetManager. I tested this app on all my devices and here it is the results: Galaxy S3, android 4 (...
0
votes
0answers
29 views

POST & push for turn-based network?

Can you create a viable two player turn-based networking implementation using only REST API for outbound and push for inbound data? If a game is comprised of, on average, 30 moves, is it a bad idea to ...
1
vote
1answer
97 views

Android OpenGL Sprite Component Pattern

Ok so I have a 2D OpenGL project that was originally a class assignment, and now I am using it to experiment with and to broaden my knowledge. Originally, I had been using the Normalized Devices ...
1
vote
1answer
42 views
17
votes
2answers
4k views

How can I implement a “disable ads” purchase in my game?

I would like to add a "no ads" service to my game such that ads can be removed with a single payment. How can I implement this correctly? If I just save the fact that the service was paid for locally ...
0
votes
0answers
28 views

Direction buttons for Android game

I am new to Android development and i am trying to develop a game. I have a basket which is used to catch different objects which are falling down randomly. Now to catch those objects, i am currently ...
2
votes
0answers
21 views

How to implement app indexing plugin, by using Prime31 UnityPlayerActivity?

I am implementing the App indexing plugin, using Prime 31 UnityPlayerActivity which is implemented by overriding Androinds onCreate, onStop methods etc, but when I use this keyword in onCreate method ...
0
votes
0answers
35 views

HorizontalScrollView with multiple views in one “frame”

I have ImageButton, with TextView and ImagaView inside it. I have six of these. So I want to implement them into HorizontalScrollView. I remember I had one HorizontalScrollView with images some time ...
1
vote
1answer
47 views

Libgdx black rectangles problem

I'm working on a game for Android using Android Studio with LibGDX in Java. I recently found a weird problem when closing and reopening the game. When I first open the game, it works fine. If I click ...
0
votes
3answers
124 views

LibGDX simple button with image

I want to make two image buttons (play, restart) in my main menu screen but I dont know how to do it. I tried this: Texture playTexture = new Texture(...) Image playImage = new Image(playTexture) ...
2
votes
0answers
105 views

Bilinear filtering by sampling corners of a texel

I'm trying to do bilinear filtering in texels to get the convoluted value of a 3x3 block. Implemented as below: offsetx = 1/width offsety = 1/height Fragment shader: "varying vec2 vTextureCoord;\n"...
0
votes
1answer
33 views

libgdx collision on moving Rectangle with other Rectangle

I'm making a soccer game where you touch the screen and the player shoot the ball to the touched position with the objective of scoring goals when it hits the goal. The player is just a Sprite and the ...
0
votes
1answer
27 views

libgdx sprite placement

Im making a soccer game where you basically have to shoot the ball to the goal and the ball goes to where you touch the screen. Im having an issue with the ball though, when the ball spawns on the ...
1
vote
1answer
38 views

How to know when Android OpenGL Context has been preserved?

I am implementing a pause menu for my game in Android. If the activity pauses and then resume, It lose the OpenGl context. However if you use setPreserveEGLContextOnPause(true) it MAY preserve the ...
-2
votes
2answers
34 views

i want to make four letter one word game. i have designed xml but getting problem in main activity java. [closed]

i want to make four letter one word game. I have designed xml using four imagebutton and randomly load from string array, but how to code entire java file. i am beginner to programming.
0
votes
0answers
28 views

Libdgx and Overlap2D export settings for Android

So I have a problem when exporting assets from Overlap2D to Android Studio project location. When setting up libgdx I set the project to be for desktop and android and selected Overlap2D extension. ...
0
votes
0answers
26 views

Is there a specific file in the NDK that I need to link Unity3d to?

This is Android Development. I'm having issues with Unity saying that Android NDK isnt installed. I gave it the file path to the NDK directory. Its the exact NDK it told me to install (Unity). Do i ...
0
votes
0answers
49 views

Unity Android character controll with UI Buttons

So I'm trying to find a good tutorial which will explain how to controll character in 2D game when button is clicked (left, right, jump button). All the tutorials I've found are outdated and not ...
0
votes
1answer
68 views

Unity5 build won't run on android 2.3.3

I made a game using one of the Unity tutorials on their site and now would like to run on my phone (LG P500). But when I try to run it on the device, it says "Failure to initialize: Your hardware does ...
0
votes
1answer
64 views

Sprites blurred in Unity (filter mode set to point)

I'm new to Unity and I'm developing Android game. When I connect my phone with Unity Remote and launch game, all textured are blurred and they look awfull. Did some research and set Filter mode to ...
0
votes
0answers
68 views

How to update projectile trajectory point?

I am a new game developer, I am making a game, but I have a problem, I don't know how I can update my trajectory point in OnDraw method. Could anyone please help me? Thank you! Here is my code: ...