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

12
votes
1answer
1k views

How to reduce image size without pixelation?

I see lots of games with smooth edges characters and high res images, however when I try to reduce images to say 64x64 for my character I just get a pixelated mess. even if I start with a 64x64 canvas ...
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
1answer
317 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
240 views

error in post a screen shot of game scores with Android Intent in LIbgdx game [closed]

I want to post a screen shot of my game on social apps. I have developed this game using Libgdx framework. I have created an interface in Core class. Here is its Intent share specific code. ...
2
votes
2answers
14k views

Creating offline multiplayer Android games with Unity

Is it possible to create offline multiplayer Android games with Unity (played over bluetooth/ wi-fi)? If so, then I would like to create a 2 player game prototype, containing a single room (empty cube)...
1
vote
1answer
128 views

How could I draw text in an 'info bubble' with libgdx?

I am making an android game using libgdx where there are textures on the screen which represent people. When you touch a person sprite I want a little info bubble to pop above their head displaying ...
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 ...
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
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
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
50 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 ...
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 ...
1
vote
3answers
1k views

How to make an Actor follow my finger

I'm back with another question that may be really simple. I've a texture drawn on my spritebatch and I'm making it move up or down (y-axis only) with Libgdx's Input Handler: touchDown and touchUp. @...
0
votes
0answers
29 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 ...
1
vote
2answers
190 views

In-app update, live update, hotfix for mobile game

I'm researching how to make an in app update on mobile game. When there is a hotfix, or an update, users don't have to go to Playstore, or App store to update but update inside the game. (E.g. Clash ...
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 ...
1
vote
1answer
242 views

Change screen from main menu to game

I'd like to know how I can change the screen from the Main Menu to the Game itself but im having quite the trouble and I would appreciate the help. What I want to do is when I press btn.Play it ...
0
votes
3answers
127 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) ...
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 ...
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"...
1
vote
1answer
61 views

Canvas doesn't draw

I've set app view on XML based layout: setContentView(R.layout.mlayout); with some views objects on it. Then, I added another view via: RelativeLayout layout = (RelativeLayout) findViewById(R.id....
1
vote
1answer
622 views

Random Sprite Speed

I followed the Rain Catcher tutorial from libGDX and I made some modifications to the code, allowing the rain drops to appear faster. But I cant figure out how to make the raindrops fall at random ...
20
votes
2answers
33k views

Where are all the tutorials for libGDX? [closed]

I've searched online for help and tutorials on LibGDX but I couldn't really find any, except and the wiki for asking questions on stackexchange. Besides the source (demos) and wiki, is there any other ...
8
votes
4answers
10k views

What tools are available for developing 2D games like Tetris or Angry Birds for Android? [closed]

I would like to ask the following regarding developing Tetris- and Angry Birds-like 2D games for Android: Is Java the official development language for Android? What free or commercial Android ...
-2
votes
2answers
364 views

Absolute newb Java programmer seeks “dumbed-down” tutorials/resources [closed]

I understand the basics of Java and Object Oriented Programming so far, and am still working on refining my understanding of it. I have sought several different resources - two books and Oracle's own ...
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 ...
35
votes
5answers
24k views

Workaround to losing the OpenGL context when Android pauses?

The Android documentation says: There are situations where the EGL rendering context will be lost. This typically happens when device wakes up after going to sleep. When the EGL context is ...
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 ...
1
vote
2answers
734 views

Libgdx box2d crashing

im making a game in libgdx which i having a bunch of circle bodies floating around in space and when the player's body crashes into another body, that body deletes and creates two smaller bodies ...
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 ...
8
votes
2answers
7k views

VSync / real 30FPS on Android

I'm working on a game which can't run at Full speed on some devices. On Tegra2, with many optimizations, performance is near 40 fps. The framerate is stable but animations aren't smooth enough, so i ...
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 ...
2
votes
2answers
3k views

Unity Android Unable to convert classes into dex format AdMob

I'm a beginner Unity programmer (school-age), so I don't know that much about the system. On its own my app compiles fine, but when I implement the AdMob SDK (Google) 2.1, I have the following error ...
7
votes
2answers
2k views

SQLite in libGDX

Does anyone have an example of how I can use SQLite in libGDX? I have a class in my original Android code that allowed me to easily access a database but I can't seem to find anything equivalent to ...
-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.
6
votes
1answer
202 views

How to detect collision only in non-transparent texture?

I am developing a game using libgdx. I am trying to detect the collision between bee and tube. I am using the following code to detect the collision. if(player.getBounds().overlaps(boundsBot)){ } ...
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 ...
2
votes
1answer
101 views

LibGDX How do I create a Shop? [closed]

My game is fully working but now I want to make a shop so that the player can buy boosts or other useful stuff for the money the player has collected. What is the best way of doing this kind of shops:...
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 ...
1
vote
0answers
80 views

Libgdx stops all sounds when there are lots of sounds

I'm making a 2D game for Android using Android Studio with Libgdx in Java. I have a class, called SoundPlayer, which holds an ArrayMap. The key is the name of the sound file and the value is the sound ...
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: ...
5
votes
2answers
629 views

Main game objects as static

I'm making a game for Android using Android Studio with Libgdx in Java. In my game there are main object like Screen, ObjectFactory, SoundPlayer, Painter (Responsible for drawing) and a few more. 'til ...
0
votes
1answer
50 views

Simplifying Object Factory

I'm making a game for Android using Libgdx with Android Studio in Java. In my game, I have a class called ObjectFactory which has a method createGameObject(int objectType) which receives an integer ...
0
votes
1answer
55 views

How create/draw faded circles in Java

How do I create some circle - like the one on the image - in Java, and in various colors? I would like to make more of these circles to fly from specific position to random direction.
0
votes
0answers
24 views

AdMob Banner appears 960x150 instead of 320x50 in libGdx - what's wrong here?

I am a bit helpless with this strange effect from AdMob. AdView is instanciated in code and so is the relative layout and libGdx view. View view = initializeForView(Engine.createEngine(G....
0
votes
2answers
123 views

Java RPG class implementation (design pattern ?)

For my school project I'm making a little NFC based game on Android. The concept is simple, on each phone you create a character and you can fight with other people through NFC. The character will ...