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

Handle GCM registration tasks

I have implemented Google cloud messaging in my mobile app following the Google docs. It seems I have a lot going on in my MainActivity class at this point. I'm ...
1
vote
0answers
16 views

Few DatePickers and TimePickers in Android activity

I'm developing an Android activity which asks user to enter start and end dates and times in order to know a certain period of time. After picking start date, user picks start time, and then he/she ...
6
votes
1answer
411 views

Login UI for an Android app

This code starts a new thread for login and reacts according to the JSON result returned by the server. I think this code has too many conditionals, exception handlers, and nested functions. ...
4
votes
1answer
28 views

Async Task with multiple requests in android

I am using this AsyncTask class to update two different tables on SQL Server. So far this code works fine, I'm interested in a better and more sufficient code ...
-1
votes
0answers
11 views

Live Wallpaper stops on preview [closed]

Following this tutorial here, I've trying to take a gif create a live wallpaper out of it. No prior background in java I've made it this far: ...
2
votes
0answers
30 views

Retrieving the most recent posts from the users someone is following

I have two different implementations for retrieving posts from the users someone is following and I want to know which one you would recommend using. First I'll show you the tables, and then the two ...
3
votes
0answers
47 views

Getting contacts from phone is taking too much time

I am working on an instant chat messaging application. I am getting contacts from phone and displayed them in list view of an activity, but it is taking 25-30 seconds using the following code: 1. On ...
0
votes
0answers
28 views

Filtering based on actions and keywords

I have an Android function that when an intent is passed, it filters based on the actions and keywords. How can I improve this function? ...
2
votes
1answer
85 views

Sudoku Android Code

I have been programming for a long time, but nobody has given me any feedback if my code is good or not. Please review it, and give me feedback where I could be better. The source code is also on ...
1
vote
1answer
55 views

DBSCAN in C++ for general and Android use

I've implemented a templated DBSCAN for general use. At the moment, it's going to be used on Android through the JNI. I used Wikipedia's pseudocode and a little bit of the DBSCAN paper for reference. ...
5
votes
2answers
79 views

StopWatch app in android

Activity ...
4
votes
1answer
36 views

Pulling from data from SQLite DB on Android

Apart from merging the 2 get methods, what else can I do to optimise this? Both input and output cannot be changed. Is there a way to iterate a map while writing to it? ...
0
votes
0answers
28 views

Prompt to pay for in-app purchases

I have the following code that prompts the user to pay for an in-app purchase when they click a button. I was wondering whether it was efficient or not: ...
0
votes
1answer
52 views
2
votes
0answers
68 views

Android Studio Background Service to Update Location

I have this background service, which runs continuously even when the application closed (Paused or Stopped). The service is to retrieve the user location and post it to server. Here's my code. ...
4
votes
2answers
59 views

Simple Timed Cache by Wrapping HashMap

Just wanted to get a bit of feedback on this simple cache. My use case is to store this data on an Android client to avoid making a high volume of network calls for lookups. I feel like maybe I ...
2
votes
1answer
59 views

Android SQLite architecture for a task list

I'm writing a simple Android app with a database and am trying to make the right architecture for accessing a database. MainActivity.java ...
0
votes
0answers
78 views

Loading autocomplete text view adapter dynamically using async task in Android

I am working on an app in which I need to get destination list from server and set it in autocomplete text view. I am using text watcher and on its onTextChanged event I am fetching destinations data ...
5
votes
1answer
56 views

Drawing Routes on a Map

I have this class: ...
3
votes
1answer
29 views

Synchronization of new data with previous data

I am working with synchronization for the first time. I wrote some code that I have to implement in my current work. I wanted to know if I am doing it right or am I making a mistake. Whenever a new ...
1
vote
1answer
57 views

Progress indication with animation

I have a game in which the player has to do something within a defined time. E.g.: the player has 10 seconds to complete a level. My current code animates an imageview (it's only a horizontal line) ...
8
votes
4answers
2k views

Selecting an enum for a payment transaction

I'm writing a small Android application that deals with payments and, in my function that handles transactions, I need to translate a number of installments (1-12) and whether or not it has interest ...
3
votes
1answer
32 views
2
votes
0answers
54 views

Android app that listens for commands over a socket

I've just begun programming Java and I'm working on the following code that deals with socket-based communications. Basically it connects to a client on port 8888: Gist of code ...
1
vote
1answer
40 views

Retrieving access token from SharedPreference

Here is code that retrieves an access token from SharedPreference. ...
0
votes
0answers
11 views

Streaming of songs takes longer time in android

I want to stream songs, so for this purpose I have been coded this until now. But the problem is it takes much time. ...
-1
votes
1answer
170 views

Recycler view with cursor adapter

I am trying to get a recycler viewer with a cursor adapter. I seem to miss important points, so my view gets some of the data repeated instead of all the data at once. Can anyone who knows about this ...
0
votes
0answers
21 views

Displaying three values with a title for each

I've created this layout to display three values with a title for each of them. The XML layout for the same is below. How can optimize this? The important thing here is the values are dynamic, but ...
6
votes
2answers
207 views

Android unit converter

I am developing a unit converter application for Android. The application is working correctly, but my problem is with the optimization. Is there a way to somehow optimize the code? I have different ...
1
vote
1answer
49 views

Limiting the amount of Calls to a Server

I have a server side operation which takes a percentage value from 0 - 100. The user controls this percentage using a SeekBar on the android client. Time-wise the ...
3
votes
2answers
84 views

Unit converter application

I am working on an Android unit converter application, but I came to the point where I have to assign the formulas to the calculation method. At the moment I am ...
2
votes
1answer
78 views

Check WiFi Connectivity and internet connectivity in Background thread - with a return value

I have written this class to check internet connectivity on Android, while there are many instances when WiFi is connected is taken as an implication that internet is connected as well. I wanted to ...
2
votes
0answers
74 views

First Android game: changing colors of neighboring squares

I have created a small game to learn more about Android. So the game is you start with a single gray square, and you try to take over neighboring squares. You can only attack 1 color per move, but ...
3
votes
1answer
96 views

Encrypt and Decrypt

I just want to know if my code can be weak. Can anyone also spot a mistake in my code? Encrypt ...
2
votes
1answer
112 views

Reading and Writing Messages from a Socket

This is code from my android client which communicates over wifi to a small server program (not coded in java). This is my first time playing around with sockets, so I'm sure there are lots of little ...
-3
votes
2answers
52 views
1
vote
0answers
53 views

Restarting properly

I have an activity with a timer in it, which starts an activity when the timer goes down. Before, when onPause() would get called after a phone call, my activity ...
1
vote
1answer
77 views

Android UI code for a test job

I wrote my first Android UI application for a test job, but it was declined as employer said that he did't like "the code quality". He didn't specify what he meant. But I'm very interesting to know ...
-1
votes
1answer
51 views
0
votes
0answers
121 views

Repository pattern best practices

Which option is better? In the first case, I use a universal repository that can work with any entities. The methods of this repository have many parameters, such as string queries, table names, ...
1
vote
0answers
68 views

Simple WebView with embedded videos (Youtube, Vimeo Etc…), and some more features

I tried to create a very simple Webview with embedded video's in it, that can change to vertical and not reset to its default when changed to vertical or vice versa, even tho its working just fine I'm ...
6
votes
1answer
101 views

Listview from SQLite

I'm trying to get back into programming by building an app I've had in mind for quite a while. I've created an SQLite database and have managed to get some data in it. I'm trying to display the data ...
2
votes
1answer
288 views

RecyclerView lags on scrolling

I'm having an issue where when the recyclerview has a big amount of items (say 2000) the scrolling is really laggy. Here's the Fragment code: ...
5
votes
1answer
656 views

TabLayout inside fragment fetch data from web

I am working in project that I use Tablayout inside fragment. I have three tabs where they fetch data from web service. This part of the app shows questions. We ...
11
votes
1answer
170 views

Determine differences between two Strings, for use in undo/redo feature

I made a library that adds undo/redo functionality to EditText widgets in Android. It came from problem I had building text-editing apps that deal with large ...
2
votes
0answers
298 views

Google maps class inside fragment , with marker carry object

I need someone review my google map class , here is my situation I am working in medical project , I created one class to show hospital items in map with data object , here is my fragment class , I ...
2
votes
0answers
49 views

Multi class-type Object pool based on Libgdx Pool

I've done some code so you can obtain Object of any Class from Pool, take a look at it, is it safe? At least it works. MultiPool class has method obtain with Class param, so can know from which ...
3
votes
1answer
33 views

Speech reorganization helper class

I am working on a speech reorganization project. I have a util class that consists of three methods: check if a microphone exists, check microphone availability, and check text-to-speech availability. ...
3
votes
0answers
80 views

Self-stopping started and bound Android service

I've written a small Service class that contains a thread pool so that it can process multiple tasks in parallel. The kicker is that is also allows clients to bind ...
3
votes
1answer
83 views

Creating an ArrayList of Maps

I am making an ArrayList that contains Map values. itemData is my ...