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

learn more… | top users | synonyms

3
votes
2answers
47 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 ...
1
vote
1answer
39 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
8 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 ...
-2
votes
0answers
17 views

Car loan calculator app not working right [closed]

I'm very new to Java and to Android programming. I'm working on a car loan calculator that works for the most part, put I'm not getting results after I click on the "calculate" button. Before I hit ...
-2
votes
0answers
10 views

properly remove fragments from FragmentStatePagerAdapter [closed]

hey guys i implemented a tab layout(an action bar with tabs) , basically it is made of using pagerAdapter and ...
-2
votes
0answers
23 views

The final local variable unreaad cannot be assigned, since it is defined in an enclosing type [closed]

public String readmsg(String uid, String fid, String pid) { ...
2
votes
0answers
63 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 ...
2
votes
1answer
60 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
74 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
45 views
1
vote
0answers
49 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
38 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
38 views
0
votes
0answers
85 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
27 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
78 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 ...
3
votes
0answers
125 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: ...
6
votes
1answer
164 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
157 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
136 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
30 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
51 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
76 views

Creating an ArrayList of Maps

I am making an ArrayList that contains Map values. itemData is my ...
5
votes
1answer
114 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
99 views

Java spaghetti code [closed]

How to know if my code is spaghetti or not? Is this is spaghetti code? ...
5
votes
1answer
131 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
56 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
52 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
98 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
84 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
90 views

Getting a value from shared preferences

I use this code to get values from SharedPreferences. ...
1
vote
1answer
39 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
28 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
64 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
43 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
94 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: ...
2
votes
2answers
103 views

Android utils class

I have created a Utils class, which consists of progressDialog and AlertDialog: ...
1
vote
3answers
85 views

Registration and Login System for Application

I am developing a social platform and currently just completed the registration and login PHP pages. The application is an android application that authenticates against a MySQL DB. I am seeking ...
1
vote
0answers
57 views

Passing the name of a class to the UI

I've extended FragmentPagerAdapter but reading the example implementation automatically generated by Android Studio's "tabbed application" preset, ...
2
votes
0answers
44 views

Dice-rolling Android app

This is just a simple app. All it's suppose to do is move the dice around the screen when the user swipes up or down. It will move 2 dice (image drawables) to a position on the screen depending ...
1
vote
1answer
45 views

Null check when enabling Up navigation in Android

This upvoted SO answer and this upvoted SO answer both check for null in a similar way: they call a function in the if or assert ...
2
votes
1answer
31 views

Validate interactions between Activities

I am developing an application to validate the interaction between activities through intents. I created 5 ImageButtons with an image for each. Each button is a ...
4
votes
2answers
114 views

App to list books from JSON data

I recently submitted the code for this for an 2 hour interview but I was rejected. The app shows book information with a image, title, and author. Each entry has a title but some entries have no ...
5
votes
1answer
64 views

Randomly Generate Planets

This is code I'm writing for an android game where I want to be able to randomly generate small planet sprites. It seems like the best way to do this is to have a set of small PNG textures that can be ...
0
votes
0answers
39 views

SQLite app for local storage

When I make an app using SQLite for local storage I've settled into a nice routine; create a contract class and a extended BaseColumns class to hold column names ...
0
votes
0answers
137 views

Java API with OKHTTp

I have class that reads an API by using the Okhttp library. Is there any way to improve the code? ...
3
votes
2answers
210 views

Login activity in Android

This is a complete login activity class. What I need reviewed: I need simplify my code as much as possible. Is it wise to use the butterknife library, or is the normal way better? Hide keyboard ...
1
vote
1answer
43 views

Dismissing a modal dialog

I am implementing a modal dialog in my Android application, allowing the user to either pick a player from a list, or create one with predefined traits. Below you can find part of the relevant code: ...
1
vote
0answers
256 views

Using the same RecyclerView.Adapter with a different ViewHolder

I would use the same RecyclerView.Adapter with two or more different fragments. Every fragment uses a different view items layout so I must use a different ...