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

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 ...
1
vote
1answer
16 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 to find what item is the same. Here is my code: ...
0
votes
0answers
13 views

android - custom ListAdapter with ViewHolder Pattern

I write this class for custom list adapter for my list view , I use view holder pattern to make list view move more smooth could any one advice me if I do something wrong , or something I can refine ...
2
votes
2answers
56 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
58 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
25 views

AsyncTask alternative with Runnable and CountdownLatch

What is wrong with this pattern which emulates AsyncTask functionality?: ...
3
votes
1answer
92 views
+100

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
66 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
58 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
58 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
18 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
45 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 ...
2
votes
0answers
28 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
46 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
131 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
74 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
15 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
38 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
65 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
31 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
84 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
50 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
308 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
46 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
68 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 ...
3
votes
2answers
93 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 ...
3
votes
0answers
67 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
50 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
42 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
57 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
39 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
79 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
96 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
142 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 ...
5
votes
2answers
274 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
137 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, ...
9
votes
2answers
450 views

Random 5-character token generator

I have an Android app that uses randomly generated tokens to log in. They're 5 characters long, are sent to a user's email address, and have a short lifespan, so I don't think I need anything that's ...
2
votes
1answer
83 views

Using a Subject to trigger a music list to reload

In my Android app I have a Service that is periodically polling a server for a music playlist XML. For certain occasions I also want to trigger a reload manually. I am using Retrofit for the server ...
4
votes
2answers
167 views

ThreadPoolExecutor singleton

I'm trying to build a ThreadPoolExecutor singleton to use it across my app. I'm very new to this concept and after going through Google docs I have created this: ...
3
votes
1answer
116 views

Tic Tac Toe Android game

Can you help me with suggestions regarding my code for Tic Tac Toe Game? This is my code, I've tested it and it works, but I feel like it can still be made shorter/clearer. I am not a good coder and ...
4
votes
1answer
89 views

Java (Android) abstract class correct implementation

I am looking for some comments on my code and whether or not this is the best way to create an abstract class. In addition, some of the abstract methods are rarely called so I use the base variables ...
1
vote
0answers
33 views

Android: accessing global data through replaceable instance

I have to access global data shared between activities in Android application. I have simplified DataProvider class to contain only one field - ...
1
vote
0answers
56 views

Fragment-changing in Android

My current code is kinda atrocious to switch fragments and everything, but I don't know a better way to check to see if the fragment I'm trying to switch to. ...
1
vote
0answers
46 views

Simultaneous works with multithreading

I have a case-study for an Android interview. I just wanted to get your opinion before I share the code with the company. There are two fragments: one of them uses a thread-callback structure and the ...
0
votes
0answers
40 views

Adding markers in Corona SDK for Android

I'm having trouble getting the marker added. (only tried on Android devices) I want to add the marker inmediately after the map is loaded. Got it working adding a delay but couldn't make it work by ...
2
votes
0answers
135 views

Map Events From calendar provider to dates in gridview

I working on a calendar app on Android, using roomaorama, which is nice. I am fetching all the events from Events table in Calendar provider once which seems not good performance wise. The library ...
4
votes
1answer
84 views

Speed unit converter

I'm basically a newbie in android app developing. So I'm not sure if this is the right way to write these codes. I have made an app called "Zconverter". It has 9 fragments and the code i m showing ...
6
votes
2answers
438 views
2
votes
1answer
44 views

Asynchronous login form handler

I have an app that user submit the log in form , when it sent the data to server app create a connection for its account. In this connection i have an integer field named as state. the state value is ...