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

learn more… | top users | synonyms

-1
votes
0answers
12 views

How to hide 2 incorrect answers and how to identify correct answer (Android Quiz) [on hold]

Just like who wants to be a millionaire game, i want to disable 2 incorrect answer if i click the button HELP and to get the Correct answer, I used button.setVisibility(View.VISIBLE); to show the two ...
-3
votes
0answers
12 views

I'm trying to validate email address from my server .I'm using android volley to send and receive data [on hold]

I've written a function with Boolean return type but while I'm using volley, I get reply in "Public void onResponse(String response)" and I'm not able to return boolean value from it. So, I'm stuck ...
0
votes
0answers
14 views

Custom EditText class

I tried to create custom controllers to full control and I started with EditText. I created a PCL project to hold all these controllers so I can't create custom ...
-1
votes
0answers
17 views

Where to store api keys in Android? [on hold]

Every time when I connect to some API, I think: "What is the best place for this key?" I think, it is question of modifiability and security: how easy future developer will find and fix the key if it ...
3
votes
2answers
48 views

ListView Activity logic

I'm a beginner in Android and I've been experiencing "Skipped xx frames" everytime I load up my activity which is a list of languages. I tried optimizing the listview following tutorials (applied ...
9
votes
2answers
246 views

Find index of double number delimiter

I have a String with a double number. Unfortunately, the number is created on backends with different locals, so it could be both 101.02 and 101,02 (different delimiters). I need to get position of ...
4
votes
2answers
63 views

Reading complete contact information in Android

My goal is to read complete contact information on an Android application. This is very slow and my understanding is that since the contacts are stored locally in a phone database, it shouldn't take ...
1
vote
3answers
83 views
+100

Android recyclerview filter

I want to optimize the below code, I have asked a similar question here. I know this approach is better than my last code but I feel there are ways to optimize this too.This code is used in almost ...
5
votes
0answers
25 views

ActivityLifecycleHelper implementation advice

Description The ActivityLifecycleHelper uses wrap(Context)to create the class & save a global ...
3
votes
1answer
32 views

The sorting in the app with fragments

This phonebook application has a menu, which sorts by name or category. I do it like this in MainActivity: ...
3
votes
2answers
56 views

Compress an array of strings in Android

I'm compressing an array of strings in an Android app. Is there something you would suggest? ...
4
votes
1answer
154 views

Android recycler view adapter filter

I am trying to optimize the filter method for RecyclerView Adapter in Android. The list is used as an ArrayList. I have seen ...
3
votes
0answers
27 views

PopupMenu implementation that hacks inflating a @MenuRes

Summary Usage will ask for a Context and a @MenuRes and then use the ...
1
vote
0answers
46 views

Small camera app in react-native for Android

I'd like you to help me review a small camera app. Most of the code comes from here; I just changed it a little bit. I started dabbling with react-native for the first time. It seems kinda neat but I ...
1
vote
0answers
210 views

Refactoring API endpoint class in Android

I have a class with multiple methods which return a URL string of an API endpoint. Each methods takes different parameters based on what the endpoint have to include. Example, GET: http://api....
0
votes
0answers
24 views

Changing the background with a Fragment

This Fragment changes the background of the application. It works well, but sometimes it takes a long time to open. I mean the lowest version of Android, like Kitkat. Is it possible to upgrade it? ...
0
votes
0answers
36 views

Drawing something on an Android phone

This is my class. The class extends View and I use it on activity_main.xml. I have tried to make my code great and easy understand, but I don't know that I have achieved it. This class just allows a ...
1
vote
1answer
39 views

Creating an AlertDialog with a list

I am wanting to implement an AlertDialog with a list into my app and I created a sample to see if I can get the result that I am looking for. It seems I do have the ...
2
votes
1answer
38 views

Animating multiple views in Android efficiently

I am currently making an application where the user will launch the app and the first this we see is the app logo fade in at the center of the screen. After about a second, the logo will translate up ...
1
vote
1answer
26 views

TextView vs Button for Android AlertDialog

I want to open an AlertDialog on the click of either a Button or TextView but I am not sure ...
2
votes
2answers
80 views

Calculating Pi with Android

I'm kind of new to Java but I am writing an Android app. Right now I'm working on an async task to calculate Pi but when I run it the memory usage increases alarmingly (+5MB per second). This one ...
5
votes
0answers
39 views

Drawing a Koch snowflake in Android

Here's my attempt to draw Koch snowflake. My initial state is a line instead of an equilateral triangle so that I am able to fit maximum detail in a mobile phone window. My thought process was: Given ...
2
votes
3answers
92 views

Storing quiz questions in SQLite

I am creating my first android app. It is going to be a quiz. There are 40 different question categories and each category has its own database table. I am writing all questions into a sqlite database ...
4
votes
1answer
90 views

JSON loader with event bus, cache, and session

I have an Android application which needs to retrieve JSON files from a server and then display the information in my app. To accomplish this I have the following architecture: The main activity adds ...
1
vote
1answer
40 views

“Photo Sales App” exercise as homework, and processing multiple checkbox “isChecked” values

I've done this assignment here for my android programming course I'm taking. The exercise requirements were to create a single-activity interface for selecting a 'photo package' to purchase, and to ...
0
votes
1answer
46 views

DatabaseHelper with multiple tables

I am programming my first android app. It is going to be a quiz. It will have 40 different categories of questions and for each category I am going to have a SQLite Table, which holds the questions ...
2
votes
2answers
58 views

Android - Share ToolBar across whole application

I have 3 ToolBars that I use across my whole application The first one is just a ToolBar with a close button. The second one is a ToolBar with a close and delete icon. The third one is a ToolBar ...
2
votes
0answers
48 views

Refactoring App launch sequence using reactive programming

In the SplashActivity of my Android Application, the following sequence of events occur: Check if Google Play Services is installed If Google Play Services are ...
0
votes
1answer
44 views

Android - handle navigation to multi activities from list view

Here is my case I made list of items when I click at any item it should navigate to certain activity. Here is my I am done First I set number of constants to distinguish between each activity ...
1
vote
0answers
109 views

A BaseActivity to render toolbar and navigation drawer

I'm new to Android programming and this is my first project so I'm not sure if this is the correct method of rendering the toolbar or the navigation of the drawer on the screen: So I have a ...
1
vote
1answer
76 views

ِAndroid - create class to handle MarshMallowPermission

Here is my class that handle all MarshMallow Permissions I prefer separate it class as I will call its methods in all my app . at first I get used to check permission by this way ...
1
vote
0answers
33 views

Combination of Java's Future and Android's AsyncTask

My goal is create a class which implements Future interface of Java (get, cancel, isDone...), yet provides callback like ...
0
votes
1answer
89 views

HttpRequest class using AsyncTask for Android application

I am using the following class to retrieve a http response, which contains data for my Android App. Everything works fine, but there is a performance issue. I get the following warning when requesting ...
1
vote
0answers
18 views

Cursor adapter adapts text views to wrong location on list view [closed]

I'm adapting data to a list view using a database adapter. Here is the code in my main activity setting the database adapter to the list view. ...
0
votes
1answer
55 views

MainActivity RecyclerView lags

My app, particularly the MainActivity suffers from some lag when I scroll through the RecyclerView. I tried to fix ...
1
vote
1answer
162 views

Testing a ViewModel in Android - MVVM with DataBinding

I am using MVVM pattern with databinding. I have written tests. But I want them reviewed. The test is related to JUnit test on the ViewModel. FeedViewModelTest....
1
vote
1answer
60 views

Android log in file for testing purpose

I have created a method which shows log in logcat and also writes into the file. Every time this method is called it appends String in file. There are so many read/write operations on disk/non-...
1
vote
1answer
92 views

Android RecyclerView holding rows of razzles

I have a RecyclerView that works and everything, and this is how I coded it: ...
2
votes
0answers
125 views

Android generic SQL database handler

Starting with the fact that creating the classic database handler in Android is really annoying and it usually takes a lot of time since you have to create one handler for each object, I thought at ...
0
votes
0answers
68 views

Android Login Screen implemented in Model-View-Presenter Pattern

So this is my first time implementing the MVP pattern in Android. As I understand the presenter should not contain any Android specific code. I am using ...
1
vote
0answers
84 views

Send a volley request in the background every 10 seconds to a server

I created a class called HomeService that extends the android.app.Service. I then declared and implemented a class called BackgroundService which extends Thread. In the run method of the class I call ...
5
votes
2answers
194 views

Android Activity with a RecyclerView inflated by a big ArrayList

This Activity has got a RecyclerView that is inflated with an ArrayList that is ca. 400 Elements. This is what an Element of ...
2
votes
0answers
38 views

Implementing FusedLocationProvider for more than one Activity in Android

I am trying to implement Google Maps in Android. I am also trying to learn different design patterns. I want to use location in more than one Activity hence I have used a class named 'GoogleLocation' ...
4
votes
0answers
76 views

Communicating upwards from nested fragments in Android

I recently asked this question on Stack Overflow, but now that I have a working example, I would like to have it checked. I set up the layout like this: I am going off the idea that parents can talk ...
1
vote
0answers
39 views

Android Internal Resource Reader

I'm not really sure if this is right, so it would be great to have it reviewed. I'm creating an Android library and made a final class with completely static methods for getting internal resources (...
2
votes
1answer
62 views

Using a new thread to post to observers

I have implemented my own Observer pattern. I want to post my events in a new thread. This thread would simply call all the the observers/listeners with the posted event. ...
6
votes
3answers
340 views

Finding and moving the next obstacle in a player's path

This code finds the next obstacle in the player's path, then moves it. I am trying to make it more efficient, because this code runs for each frame, and it lags a bit. It does work though. There are ...
6
votes
1answer
175 views

Simple calculator in Android Studio

I have been learning Java for a few months now and have created a basic calculator application in Android Studio for a school project. Since this is my first attempt at programming, I am sure that my ...
3
votes
1answer
84 views

Base activity for handling network state changes in Android

I had the need in one of my activies to handle displaying a message to the user when the network disconnected, and then reload the data for a RecyclerView adapter ...