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

learn more… | top users | synonyms

0
votes
0answers
11 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 ...
-2
votes
0answers
11 views

how to split the span text using sax parser in android [on hold]

public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { currentElement = true; if ...
5
votes
1answer
38 views

Drawing Routes on a Map

I have this class: ...
2
votes
1answer
25 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 ...
0
votes
0answers
31 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) ...
7
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 ...
0
votes
0answers
13 views

Best Pratice to write Button.setOnClickListener in Android [on hold]

I am starting with android and I have seen couple of different approaches to set onClick event. First one is to set method name in XML itself ...
3
votes
1answer
28 views
2
votes
0answers
39 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
32 views

Retrieving access token from SharedPreference

Here is code that retrieves an access token from SharedPreference. ...
0
votes
0answers
10 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
56 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
17 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
197 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 ...
-3
votes
0answers
33 views

Android ProgressDialog Utility

I'm trying to create a progress dialog that can be called and dismissed with a single line. The main concern I have is whether or not I'm leaking my context by having the static ProgressDialog use it ...
1
vote
1answer
47 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
78 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
67 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 ...
-1
votes
0answers
19 views

Android Map util class

I am working in project that uses maps , I create util class for maps here is the code , could any one review it and tell me how to refine my code. my question is it wise to separate this method from ...
2
votes
0answers
69 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
73 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
96 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
48 views
1
vote
0answers
51 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
58 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
45 views
0
votes
0answers
102 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
44 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
90 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
196 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
344 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
160 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
210 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
36 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
32 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
63 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
82 views

Creating an ArrayList of Maps

I am making an ArrayList that contains Map values. itemData is my ...
5
votes
1answer
161 views

Calculate sum of all the items in array list?

I am setting the sum total of all the items in an array to a text view in android.The values contained in the array are all currency values. ...
-2
votes
2answers
106 views

Java spaghetti code [closed]

How to know if my code is spaghetti or not? Is this is spaghetti code? ...
5
votes
1answer
147 views

Tic-Tac-Toe AI Player

I made a simple tic-tac-toe AI app, where the AI, who is always O, wins or ties. I just wanted some input on it, and wanted to know if there was any ways to improve it (not the functionality of it, ...
0
votes
1answer
64 views

Android manage constant class

I create constant class , include my url constant , my user web calls .... etc I put my constant class in Utils package here is my questions , is it good to inset constant class in Utils package ? ...
1
vote
0answers
53 views

Calculating Net Rate and Total based on text change

I am using Text Watcher for Rate and Making(Charges) which are my edit text fields on text change I am Calculating the Net Rate and Total. There are two conditions here: I am fetching values from my ...
5
votes
2answers
103 views

Hashing user passwords

I've written a Java class that will provide the utility of, in essence, hashing user passwords for an Android app that integrates Couchbase mobile into it, and then, checking whether or not the ...
1
vote
1answer
105 views

Simple login and authentication app

For school I had to do a real simple login and authentication system on an Android app, and I'm wondering how my code can be optimised to reduce code duplication and how it can be made more object ...
0
votes
1answer
110 views

Getting a value from shared preferences

I use this code to get values from SharedPreferences. ...
2
votes
1answer
44 views

Android: enforce what is passed to an activity in an intent similar to the newInstance pattern for fragments

For fragments I have this code to create a new instance: ...
2
votes
0answers
33 views

Android SharedPreferencesManager class

I need someone review my sharedPreference class , which better to create sharedpreference with constant name MyPREFERENCES like this , or like they I do in class ...
1
vote
0answers
77 views

Dice rolling swipe Android app

So I've got an Android app where if you swipe in a particular direction (UP, DOWN, RIGHT, LEFT), the dice move in that direction using TranslateAnimation. This is ...
3
votes
0answers
46 views

Hourglass path in SVG for Android

I've created my first Android drawable, a hourglass shaped image, and I'm curious what can be improved with it. It seems weird having to use 4 paths, but I couldn't get it to work any other way. ...
2
votes
1answer
115 views

Login/registration part of an Android application

I made some PHP files for the login/registration part of my Android application and I would like to know if it can be made safer. config.php: ...