Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com
2
votes
0answers
10 views
Easily add Accessibility to your app as an afterthought. Yes, as an afterthought
Accessible apps allow more users to use your app; however, it is usually an afterthought for developers, and it makes your XML layout files messy whether Accessibility was a forethought or ...
3
votes
1answer
60 views
Using a LinkedList type of adjacency list to create the word game: WordLadder
Goal
The user puts in a starting word and an ending word. My code creates a ladder between these words of words that are different by one letter.
Start: gain End: fire
Output:
gain
gait
wait
wart
...
0
votes
0answers
24 views
Android network api request
I often use a similar scheme work with api project. Maybe it can be made easier, or is there a standard approach?
This class who create api request.
...
3
votes
1answer
63 views
An app that uses the quadratic formula to solve ax^2+bx+c=0 so long that the answers aren't imaginary
I'm a beginner to Java and Android programming, and I wrote this app in order to get some practice. It works, but it's most likely not as good or efficient as it could be, since I'm new. I'm hoping to ...
4
votes
1answer
51 views
Card payment strategies
In my project, I have 3 payment mode. Via Manually Entered , Card Swipe, and cash. I have 2 fragments named RecordCardManuallyFragment and ...
0
votes
0answers
16 views
Declare Parcelable KEY String constant INSIDE Parcelable class? [on hold]
I would like to know two things:
How others hold String constant used for Parcelable key
Idea or opinions about declaring <...
1
vote
0answers
62 views
Full screen WebView Android app
I've created a working Android app for my project website. I'm newbie too android dev so please review the code of this app. Any simplification or suggestion to optimize it much appreciated.
Thank ...
0
votes
0answers
20 views
Animating fragments [closed]
I have a very specific question regarding animations in Android. If I have a lot of animation code inside an Activity, View, or <...
2
votes
1answer
33 views
Continuously execute runnables on the UI thread
I need to run a sequence of runnables on the main (ui) thread with a given delay between them indefinitely until signalled to stop. Code:
...
2
votes
1answer
59 views
Interactive Android AppWidget collection to populate activity on click
I recently developed my first appwidget for Android, and it works really nice. I basically created a collection widget and use a Loader to retrieve the data from a database, and when a user clicks on ...
1
vote
1answer
54 views
Tight coupling in using call back method
I am using below code and for result i am using interface for call back purposes.
...
1
vote
0answers
87 views
Code that checks input for calculator app
I made an Android app, a calculator, that uses buttons for input, Android keyboard is turned off. I have a block of code, that handles the input to string and checks for some things at the same time. ...
3
votes
0answers
30 views
Animation for android ImageViews acting as game pieces
My question is about how to achieve a well-performing animation for a set of ImageViews, so that the foreground fades away and the background stays the same.
...
-2
votes
0answers
43 views
Evaluation of SOAP and REST based code for Expressitivity
Currently I am doing a project for my Master's thesis and have to evaluate web service standards for Web of Things applications(Real-time Patient Monitoring System).
Below is code I have written in ...
0
votes
1answer
44 views
Square ImageView
This is good practice, to make square image? Side of the square container is equal to its width.
...
1
vote
1answer
72 views
Retrieving location coordinates from SQL database and plotting on a map android Gmaps
I am new to Android development. I am currently working on an Android app that fetches changing location coordinates from a SQL database, and plots on a Map view at regular intervals. But I think this ...
1
vote
1answer
64 views
Logging in to Android application using Firebase
I currently have an app that uses Firebase for logging users in and I would like to know if I can make this code any better. I currently have 4 files:
auth/models/User.java
auth/BaseActivity....
1
vote
2answers
79 views
Populating a Fragment/Activity dynamically on Android gets ugly
So here is the ugliest fragment of my application, I tried to reformat as much as I could but I think it's still pretty ugly.
Basically, I'm trying to use an API call to receive JSON which tells me ...
0
votes
0answers
37 views
Calculate point on scaled, translated and rotated canvas
I've got the following two methods, written for xamarin:
...
1
vote
2answers
82 views
Properly structuring SQLite classes/operations in Android
I am new to Android development and I want to ensure I'm learning decent practices for doing things. Right now this is my database class, which currently allows me to make a new instance of the ...
0
votes
0answers
28 views
3 data related RecyclerViews, each in one page of ViewPager
I have ViewPager with 3 tabs. In each of them is one RecyclerView. Each of the RecyclerView ...
5
votes
1answer
157 views
Simple Background Thread Worker Class (follow-up)
This is a follow up of Simple, generic background thread worker class
What changed?
Moved from synchronized lazily evaluated static instances to true Singletons per the on-demand holder idiom https:...
3
votes
1answer
67 views
Using generics to find a View by Class
This works but feels clunky - any suggestions for improvement?
...
1
vote
0answers
51 views
Paho MQTT client in Android that has to be accessed in multiple activities
I am having an app that has multiple activities and uses MQTT.
I am using the Paho client in Gradle dependencies as follows:
...
2
votes
0answers
32 views
Class for serializing generic gson objects
I realized I had just created two classes that were virtually identical for simply saving objects to their own json files, so I've attempted to make it more generic. My only noticeable problem is ...
1
vote
0answers
40 views
Get vertical acceleration from rotation vector and accelerometer values
My goal here is to calculate the acceleration towards the ground, which I call "vertical acceleration". This seems to be working OK for the most part, except when there is a lot of rotation going on ...
4
votes
1answer
77 views
Simple, generic background thread worker class
While I'm not aiming for a drop-in replacement for AsyncTask, I would like a utility class that accomplishes some of the same goals.
Considering the criticisms of <...
2
votes
1answer
65 views
Custom countdown timer class to replace the Android CountdownTimer
This project was made to replace the stock Android CountdownTimer class. It is more responsive when completing the timer and adds additional functionality such as ...
5
votes
2answers
362 views
Android splash screen
I have implemented a splash screen, to hold/pause the screen for few seconds and then launch the next screen. I am very enthusiastic to know if there is a more basic way to write the code.
...
5
votes
1answer
66 views
CountDownTimer that responds to clicks
The app: Creates CountDownTimers and displays them in a simple layout. The user can choose how long the timer should be through SharedPreferences and a settings activity. Each timer has a preparation ...
1
vote
0answers
46 views
Check if registered then unregister or simply unregister
I am trying to figure out which of these two calls are more efficient:
Check if listener is registered before calling unregister.
...
3
votes
1answer
145 views
AsyncTask method
Even I know that this isn't a good way of writing code, but I need to improve this.
Here I am retrieving data from Server in Json format by Posting some variables in doInbackground. Getting all the ...
3
votes
1answer
67 views
Android login system
I am completely unaware of all the Android features and available libraries.
I just designed a login system to practice it. I have referred to a few books and tutorials.
Layout
I am using relative ...
0
votes
1answer
44 views
Getting data with RxJava and retrofit
I am using RxJava with retrofit to get data from an API then filtering the data with a for loop in the onNext Method. Is there ...
1
vote
0answers
30 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 ...
2
votes
0answers
35 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
492 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
2answers
62 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 ...
2
votes
0answers
38 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
52 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
32 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?
...
3
votes
1answer
121 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
66 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
102 views
4
votes
1answer
51 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
31 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
60 views
2
votes
0answers
350 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
68 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 ...
3
votes
1answer
77 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
...