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

0
votes
0answers
24 views

Layout is different?

I know that layouts can look different on different screen sizes, but I didn't take that into account when I made this layout. So, it is designed for normal screen size, by default, and my phone ...
-3
votes
1answer
30 views

What's the best way to animate games in Android? [closed]

I read up in the android forums different ways to animate, the "drawable" frame-by-frame animation with surface view and the animation using the Movie class and image view. Which one should I ...
2
votes
1answer
52 views

Comparing the images

I have a drawable, which I want to compare to. I created a drawable object with it, and when I log it with toString, I get: android.graphics.drawable.BitmapDrawable@41f95548 I am randomly selecting ...
1
vote
1answer
54 views

Is it possible to use Android Libraries in LIBGDX?

I want to make an android application game that uses both android API like Location, even Google Maps API and also use Libgdx framework as well. Is this possible? I noticed there's an Android and a ...
1
vote
0answers
56 views

Game is responding very slowly?

I have a very simple app which removes buttons and re-adds buttons to certain layouts when a button is clicked. The problem is, this process is taking a very long time. My question is: How can I make ...
1
vote
1answer
27 views

Device model detection and comparation doesn't work

I need to detect device model, and if it is Galaxy Ace GT-S5830i, print it out. But it never print's it (it doesn't get through condition). My code: public String mDeviceModel = ...
2
votes
0answers
93 views

unity lag while moving a sprite

I'm trying to build a 2D game for android and after I finished developing the game I noticed that there was lag present when moving objects around. I tested it on a phone much more powerful than my ...
0
votes
1answer
40 views

Prevent button layout changing after one is removed?

I have a layout with four buttons in it. I end up removing one of the buttons using: View v = (View) findViewById(R.id.ViewId); ((ViewManager) v.getParent()).removeView(v); The ...
1
vote
2answers
73 views

Swap buttons in layout

Say I have 4 buttons. I want to have button 2 always swap out with another button, randomly. So, when the user taps button 2, it should swap with another button (randomly). Now, button 2 is at ...
1
vote
0answers
32 views

How can I move my button?

I am new to animations in android. I was wondering, is there a way to keep a button moving around the screen, bouncing off the walls, until it gets clicked? I was thinking to do something like this: ...
2
votes
1answer
56 views

How can I fix my audio? (prioritize)

When two audio's are played at the same time... the sound is cancelling out. How do I fix this weird phenomenon? I have some code where there is audio on button click and audio in ten second ...
0
votes
0answers
38 views

Two sounds played simultaneously cancel out? [duplicate]

When two audio's are played at the same time...the sound is canceling out. How do I fix this weird phenomenon? I have some code where there is audio on button click and audio in ten second intervals ...
3
votes
1answer
75 views

How do I stop my timer when I close my game?

Background: I have a background service with a timer. It opens up a new activity when 20 seconds are over. Currently, my app is using componentCallbacks2 to detect when the user has pressed the home ...
0
votes
2answers
96 views

Connect phone to computer? [closed]

In order to test out my game, I need to use my real life device. The problem is, android studio isn't recognizing my device plugged in: The problem: My device isn't getting detected in android studio ...
4
votes
1answer
80 views

Multiple inputs for Google Cardboard on iOS and Android?

So far I am having a problem with having only a singular input mechanism (the magnetic trigger) for Google Cardboard games. Are there any other options to augment this in order to have at least two ...
2
votes
1answer
79 views

Calculate average velocity of the object before the game start

I have a game object (player), and with device screen width and average FPS, I'm able to calculate exact velocity for the player to reach whole screen from left to right in a specified time (fx. for 1 ...
2
votes
1answer
99 views

In Unity, on an Android device, CaptureScreenshot writing to Phone, but persistentdatapath linking to the external card

I'm using CaptureScreentshot() to get an image. But when I try to access it on an Android device it's giving me: Could not find file "/storage/emulated/0/Android/data/appname/screenshot.png" When I ...
-1
votes
1answer
24 views

Change Andengine Text By clicking and typing a new text like native android EditText

I have a board in my game, with a name. I want to edit it on a button click (not by text.setText("text") method ) i want the user to enter a text and set it there. I couldnt find, how to change the ...
1
vote
0answers
43 views

How can I detect sprite collisions out of screen?

I am creating an Android game using andEngine library. I have enemies coming from out of the screen into the screen. I already know how to detect collisions, but is there any method I can use to ...
1
vote
1answer
42 views

Calculating delta time

I'm trying to calculate deltaTime, but it's not correct. What's wrong in my code? //declared outside private long timeSinceStart = System.nanoTime() / 1000; private long oldTimeSinceStart = 0; ...
0
votes
1answer
64 views

Game speed on different devices isn't same

I have an app, in which I have constant int speed = 5; On each update, the game object (player) is moving 5px ahead. Problem is, that I can't handle that on different devices - older devices is having ...
0
votes
0answers
33 views

Android onResume called after screen turned off, starting the app running even while screen is off

I'm building a simple 2D game and I am getting strange results and calls the the onResume method when I turn off the phone screen while in the game. So I have two questions: 1. How is the pause ...
3
votes
0answers
69 views

Is there a way to determine Android physical screen size?

We're currently porting our games to Android, and would like to be able to release a universal build for tablets and phones. Is there a way to determine the actual screen size or DPI in order to ...
0
votes
0answers
13 views

Android App Update not automatically installed on devices

I published my app update yesterday and users can manually update it on Google Play, but it should be installed automatically. Does this have anything to do with my certificate? I receive a warning ...
1
vote
2answers
84 views

How can I exclude my enemies from spawning in certain zones generated at random?

I have a code where I randomly generate enemy spawn position, but I want to exclude some areas since it's colliding with some sprites it shouldn't collide with. This is the code where I generate the ...
0
votes
0answers
86 views

Setting Up A Visual Studio 2015 Android C++ Project To Utilise The SFML Library And compile On An Android Device

So in Visual Studio I have installed the cross platform tools to set up a C++ project for Android and iOS such as the Android SDK, NDK and the corresponding USB drivers required to debug the program ...
2
votes
1answer
35 views

Draw lines in game scene [closed]

I want to do game for Android that allows draw lines. These lines should be physic object at the same time. I am good at Unity3D and I tried in Unity3D. But it is not supported. What engine should I ...
18
votes
5answers
2k views

How to compress game frame by frame animation to a minimum on disk

I developing a game like Age of empire (buildings on map) and for every building I have a sprite sheet for its animation. I am using frame by frame animation to animate the building ( not aware of any ...
0
votes
0answers
49 views

LibGDX: open android camera

I need help, I can't find a solution to open camera device in my libgdx app. I'm developing it only in Android for now but I have this issue. I need only to open the preview view, no snap picture o ...
3
votes
1answer
66 views

Fixing the size?

I have been stuck on an issue for 6 hours now, and would really appreciate your advice. Currently, my app isn't compatible with all screen sizes. When testing on a small size, my textview overlaps ...
0
votes
0answers
67 views

Does the sound need to be fixed?

Are there special requirements for audio for different devices? I have been stuck on this for around two days now, and would really appreciate all the help I can get. I have some audio in my code. ...
1
vote
1answer
96 views

LibGDX - Level management on a level-based game

I'm new to LibGDX and android development in general and am trying to do a puzzle game. Being a level-based game, i'm trying to make it so in every level a certain number of blocks (just rectangular ...
8
votes
0answers
194 views

Load ads in splash screen?

I have some ads that take a very long time to load. I was wondering it it is possible to have them load while the use was in the splash screen. I have looked at this answer: ...
4
votes
0answers
37 views

Only working on certain devices? [closed]

I am designing my first android game, and this is my first question on gamedev.stackexchange. My MediaPlayer is null on my genymotion emulator, but is working fine on my actual android device. I ...
1
vote
2answers
639 views

Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details

I get following error while building to Android with Unty 5.2.2f1 (with a new&clean project). Notes: I use GPGS 0.9.27 and Soomla Core 1.2.1 and Profile 2.2.1 and maximum supported Facebook ...
1
vote
0answers
19 views

Android Game Development. Type Usage for Entity Positions

I've recently started developing on Android and have made some basic apps. I now wish to start development on a game project. I have intermediate skill in Java and will be developing with that ...
2
votes
0answers
26 views

libGDX AppWarp integration problem

I have tried to use up AppWarp's old SuperJumper as a sample to create an up to date project from it with Gradle. Maybe it is good for learning. So, I have downloaded project from ...
2
votes
0answers
111 views

How to calculate delta-time on Android? [closed]

How do I calculate the time between frames on Android? I'm using this for the thread: public class GameThread extends Thread { private int FPS = 30; private double averageFPS; private ...
1
vote
1answer
21 views

Function call to AndroidJabaObject to an instance of com.prime31.PlayGameServicesPlugin causes the application to stop responding

Using Prime31 PlayGameServices attempting to call 'authenticate' causes the game to stop responding very soon after. There isn't much I can show as there's literally no logs showing up in logcat. Is ...
1
vote
0answers
87 views

Streaming 3d model --> unity android

I want to include a feature in my game that allows me to host raw 3d models (.fbx/ .obj/ etc., not AssetBundles) on a server. The game should download these files, save them to the device and load ...
1
vote
0answers
47 views

Which game engine to use for Android TV? [closed]

I am trying to tinker a bit on Android TV game development and I am trying to figure out which would be the best suited 2D/3D game engine for this purpose or, alternatively, which are the main aspects ...
2
votes
1answer
85 views

2015 android multiplayer server based Implementation

There are a lot of old posts about multiplayer implementations on SE, so i'm looking for an up-to-date answer. What is the best server-client implementation of real-time multiplayer now? I have an ...
2
votes
1answer
92 views

What happens if I increment a completed achievement on Google Play?

This question is about GPGS (Google Play Game Services). Say we have three achievements like: Achievement A: Kill a total of 3 enemies Achievement B: Kill a total of 6 enemies Achievement C: Kill a ...
2
votes
0answers
43 views

Improving Position Sync Bandwidth Usage in a Multiplayer Game

This is the class i use to sync position between clients in a multiplayer top-down 2D shooter game: [System.Serializable] public class MovementUpdateClass { public int MessageTime ...
1
vote
1answer
67 views

Switch beetween Screen on LibGdx application

i have set main class like this: public class MyClass extends Game { MenuClass menuClass; ActionGame actionGame; @Override public void create() { menuClass = new MenuClass(this); ...
4
votes
2answers
166 views

Does Google Play allow an account to log in to the same game on 2 devices?

I'm developing an online Android game with Unity. I want all Google Play accounts to have only one session logged in at a time. Do I need to write my own code to disconnect an existing session on ...
1
vote
1answer
79 views

Unity apple/google ID access?

After extensive Googleing I have not come up with a way to access Apple ID's or Google ID's from unity running in respective devices. Either ID's or something else unique to the accounts logged in. I ...
2
votes
1answer
68 views

EULER Integration

I'm a little confused over using integration to move a sprite. This is how I've always achieved this: float time = 10f; //Number of seconds to pass a pre-defined area (using the screen width in ...
1
vote
1answer
81 views

Sprites are rendered as black rectangles in android 4.0.x only

I have some problems rendering sprites correctly on a LG optimus vu (android version 4.0) with libgdx. Basically sprites are black rectangles, while other images that i declare as Texture are correct. ...
1
vote
0answers
100 views

My app has no client ID?

So I'm using the Unreal Engine 4 to make a mobile game. I'm currently trying to set up the Google Play services so I can do Leaderboards, Acheivements and In-App Purchases but I'm struggling with the ...