Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com

learn more… | top users | synonyms

1
vote
0answers
14 views

Safely using android 'Context' inside threads

Oftentimes I find myself using context inside threads, multiple times. The problem is that I do not want to hold a long-lived strong reference of it in my threads to avoid leaking it. I keep a ...
-3
votes
0answers
10 views

App has stopped working after adding parse notification module [on hold]

here is the code,one of my activities.my app works fine but when i add parse module in app..its works fine but shows the error app has stopped working at background ..app works fine ..no error during ...
0
votes
0answers
12 views

Android Zoomable Listview

I spent a day looking for a Zoomable ListView and every answer was broken in some way. Finally I found a great template and made a couple changes to handle scroll boundaries. You can extend any view ...
-1
votes
0answers
12 views

Passing arraylist value android [closed]

I have simple_list_multiple_choice adapter, when I click the button, I need to pass the value of checked item into another class. ...
2
votes
1answer
44 views

OpenGL ES 2.0 Sprite rendering

Is this a good method to render sprites (textured quads) or is there a faster or better way? Example use: ...
1
vote
1answer
21 views

Alert dialog manger class

I want to make a general alert dialog to use across the whole app. I created a class called AlertDialogManager and just one method to show ...
0
votes
0answers
21 views

Android bitmap modification and rendering app [on hold]

I have an Android app that is laid out like this: The first fragment is a textureView that simple renders a CameraPreview. ...
4
votes
1answer
26 views

Method for downloading a PDF from a website in Android

How is this? Any ways to improve? ...
4
votes
0answers
30 views

Android Google Play Services code for GPS

I'm using Google Play Services for Location in my Android app. This is my first app so I'm not expecting that I have utilized everything perfectly. My app is to get GPS/Date and send to a server ...
4
votes
1answer
89 views

Accelerometer for Lightsabers - slicing through the Dialog interfaces

I am doing a lightsaber app for fun. I followed a tutorial to learn how to get information from the accelerometer to play lightsaber sounds. It instructed me to have the Activity where I get the ...
8
votes
2answers
74 views

Camera intents and file manipulation

I am building an Android application and there are five Activity classes or if you're familiar with the MVC pattern they would usually be the ...
4
votes
2answers
57 views

Program to provide CRUD operations for a Boxers(Fighter) table in a database

I have been through a few SQLite tutorials and wrote this code on my own to reinforce the principles. The tutorials I went through varied widely in a few areas so this is what I came up with as a ...
1
vote
1answer
48 views

Lookup map for converting Strings into Android `R.raw` integers

I'm currently working on an Android app and I need to translate keys of type String to Integers which are determined at compile ...
2
votes
1answer
45 views

Play market in-app billing

I want to add in-app purchases to my application. In-app in test mode works great, but there is no check on their authenticity. While googling some info about making server-side of in-app, I found out ...
2
votes
1answer
54 views

Replace an element of a List with a concrete Id

I want to replace an object of a List with another one. To find the item to replace I need to check the field id of the object ...
0
votes
1answer
117 views

Custom ListAdapter with ViewHolder Pattern

I wrote this class for a custom list adapter for my list view. I use the view holder pattern to make the list view move smoother. Could anyone advice tell me if I did something wrong, or some way to ...
2
votes
2answers
66 views

Parsing a text file of node data into Nodes and Edges

I'm a fairly new developer (well, engineer really, but currently working on a software project). In the Android project I'm working on, I read a node representation of a map into my app and interpret ...
2
votes
1answer
123 views

Checking for Internet connectivity on Android

I wrote this code to check an internet connection and was wondering if this is the best way to do this check. ...
1
vote
2answers
48 views

AsyncTask alternative with Runnable and CountdownLatch

What is wrong with this pattern which emulates AsyncTask functionality?: ...
3
votes
2answers
165 views

Memory efficient A* (AStar) Algorithm

I am writing a solved for 15 puzzle game which will find the solution path to any NxN board. For easier boards the algorithm works great solving almost any 3x3 boards, most 4x4 boards, but when I go ...
1
vote
1answer
146 views

Xamarin image download and resizing for Android

This code addresses performance issues specific to Android running Xamarin / C# when downloading images (BMP/PNG) into a listview. The caller simply specifies the URL to fetch the image from, and the ...
4
votes
0answers
87 views

Dots game in Android

I'm trying to clone a Dots game with some little differences (power ups and objectives) as a school project. I have almost every objective done so no, I'm not trying to get my work done for free. I am ...
5
votes
2answers
64 views

Open Source Tokenizer

I'm developing an open source annotation processor for Android (ngAndroid). Part of the library is a small Java subset compiled language that can be used for data binding, events, etc. I plan to ...
1
vote
0answers
23 views

Adding rows to LinearLayouts which serve as lists

I have a fragment with a ScrollView and, inside of it, I need maybe 5 or 6 lists. To make things simpler, let's say there are three lists - list of names, list of ...
2
votes
1answer
64 views

Message queue with multiple producer, single consumer and no duplicates

I had to make a message queue in an android app which my thread takes messages from and processes them. There can be multiple producers and duplicate messages should be avoided. Rate of insertion is ...
3
votes
1answer
38 views

Data formatting using string spanning

I would like to know how to make my code better. I'm still a newbie in Android, so any tips are appreciated. The code is an AsyncTask class extender that formats data into a nice looking Spannable ...
2
votes
0answers
71 views

Using an Adapter with Parse query in Android

I'm an iOS developer new to Android. I'm creating my first Android app and I have several questions. My app uses Android Studio, gradle, and it's based on Parse (the backend). Basically, takes ...
2
votes
2answers
181 views

Validating multiple EditText fields

I am using the following method to validate if user has given any input or left an EditText empty. I am concerned about the ...
3
votes
1answer
120 views

Android Custom WebView

I have made a custom webview which is used to open a very heavy site in terms of database. The webview uses custom code for uploading files using an upload handler class. I need suggestions on how I ...
0
votes
0answers
20 views

Foundation for MVP in Android

I have been experimenting with the MVP pattern in Android, especially inspired by Advocating Against Android Fragments. I'm trying to build a library out of it, where the concept of ...
1
vote
1answer
41 views

Three buttons with click listeners that pop up a quick toast

I currently have three buttons, perhaps more to come. When I click on a button, I want a toast notification or message (popup message) to show up with some text. What I have works perfectly but it is ...
4
votes
1answer
68 views

Reading a text file API 15+

Is there a faster, more efficient way to read a text file than this implementation? Taking into account phones capabilities: ...
2
votes
0answers
40 views

Structured use of Android SQLite transactions

I got tired of following Android-SQLite's transaction idiom, briefly documented here. It requires too much boilerplate code, IMHO, especially when you add the obligatory null checks. So I came up ...
1
vote
1answer
93 views

Parsing a file for an Android device

I am trying to parse InputEvents of an Android device. Background: For an android device we have a utility getevent ...
4
votes
1answer
59 views

Porting a web-based POS system to Android

I'm currently porting a web-based POS system to Android. The Android version uses NavigationDrawer to navigate between menus. What I need a code review on is my ...
13
votes
2answers
331 views

Localizing an enum in Java

I am currently using an enum in my Android application to display time periods: Weekly Bi-Weekly Monthly Quarterly Yearly I created the enum like this, because I wanted to know the description, ...
2
votes
0answers
49 views

Parallelized image transformations using GraphicsMagick

This is part of a script that I use for porting a TWRP Theme from one resolution to another. Respectively portrait to portrait and landscape to landscape. In this function entirely, it focuses on the ...
2
votes
1answer
89 views

Android - Simple multi-activity app

This is a task from lab classes at my university. Problem statement was to showcase following features: Multiple activities in app. Passing data from one activity to another. Changing behavior of ...
4
votes
2answers
145 views

Extracting a sentence containing a specific word from a longer text

My goal is to return a specific sentence in a story that contains a given word. Returns null if the word is not in the story. I'm ok with returning the first ...
4
votes
0answers
74 views

Is this test sane? I may have re-invented the wheel on how to test that a method does not block

I have an Android service which must offload a task to a different thread but schedule the response callback unto the calling thread. After much thinking I came up with this code: ...
7
votes
3answers
53 views

Saving and restoring RadixTree object

I have a large word-file which is fixed with over 240 000 words. I need to check if a specific word exists in this list. I thought that it would be a good idea to create a ...
2
votes
1answer
45 views

Downloading, decompressing and inserting data into an SQLite database

I have implemented a Service, which executes three operations, in the following order: Downloading a compressed (.zip) CSV file Decompress the CSV file Reading the CSV file and inserting the data ...
3
votes
1answer
75 views

Functionality for automatic retry after exception

I have made the following system to automatically retry network calls if some exception is thrown. (Earlier posted on stackOverFlow, solution inspired by what @Boris answered) ...
0
votes
0answers
40 views

Switching between several animations

I am making a game and my main character has many different states. Every state has different animations, for example ducking, flying, jumping, walking, hit by enemy etc. ...
1
vote
0answers
87 views

Getting device's location once in Android

In my Android app I need to get device's location once after user clicks a button. I don't really need to keep updating localization after I get the location coordinates. I created a class which uses ...
1
vote
1answer
125 views

Android Movie Class With AsyncTask

I've got a class called Movie and within this class I use an AsyncTask to get a Bitmap from ...
4
votes
1answer
105 views

Building an application activity

I'm beginning the long process of refractoring an Android app written entirely in SpaghettiJava™. I've been programming for a relatively short period of time (two years), and have tried refactoring ...
6
votes
1answer
214 views

Android Compass

I have made my first app in Android Studio. I made a compass using a sensor-listener. I would greatly appreciate if someone could review my code (it is very short), and suggest improvements. My ...
6
votes
2answers
329 views

Android App Interview (Minesweeper game)

I recently did an Android Minesweeper app for a pre-interview coding challenge before I could talk to any engineer and was rejected. This feedback was given but I'm not sure on some of it. ☺︎ Game ...
1
vote
0answers
155 views

Android calculator app

I am new to android developement. Created calculator application. Want to improve my code quality. Will be helpfull for any advice to make the code better and more professional (overall structure, ...