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

learn more… | top users | synonyms

-5
votes
0answers
6 views

Working with Android Gcm [on hold]

I am coding two android apps,that implement google cloud messaging ,and i w ant to test the two different apps on one device,However i get this error "Invalid Registration".Is there a walk around this?...
-4
votes
0answers
10 views

Push notification issue for some devices, if the app is removed from background in Android [on hold]

In some android devices the push notification is not working, (Asus, Xiaomi..). I tried with both GCM, FCM both have the same issue. But in some devices its working fine( nexus 5x, moto, samsung).
3
votes
1answer
23 views

The sorting in the app with fragments

I make the application "Phone book". The application has a menu, which is sorting by name or category. I do it like this in MainActivity: ...
3
votes
2answers
47 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? ...
2
votes
1answer
83 views
+50

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

Some buttons not showing in an android app created in android studio [closed]

Hello I have placed six buttons and an image view in an app in android studio inside the Relative Layout. All the buttons and image are visible in the preview tab of android studio but the second last ...
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
31 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
22 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
21 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
35 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
37 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
35 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
23 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
79 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
89 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
88 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
0answers
26 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
43 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 ...
1
vote
2answers
41 views

Android - Share tool bar across whole application

I have 3 tool bars that I used across my whole application First one just toolbar with close button. Second one toolbar with close and delete icon. Third one toolbar with close and home icon. ...
2
votes
0answers
46 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
43 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
101 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
71 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
32 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
86 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
16 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
53 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
153 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
57 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
89 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
118 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
64 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
77 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
186 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
36 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
71 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
38 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
61 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
146 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
76 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 ...
3
votes
0answers
64 views

Tablayout code for Android

I am using Tablayout for an Activity in my app but for some reason icons for each tab using ...
0
votes
1answer
47 views

5 input based search form for Android

I've been trying to look for a better way in which a user has up to 5 inputs in which they can search for results in a database. I have 2 EditTexts in which the ...
4
votes
1answer
75 views

SearchActivity to search through an ArrayList<Obj>

I've coded this class that lets me search through an ArrayList displayed into a RecyclerView. This is the class: ...
-2
votes
2answers
87 views

How do I reduce the use of if else in this display function?

I have a method which uses the same code over and over again. I would like to optimize my code in such a way that there is no repetition in my code. I am sure there is a better way to do things ...
0
votes
0answers
64 views

Download of files in Async task for Android

I am using AsyncTask in Android to download files from the server. Is there a way by which I can improve the process? Can the download happen any faster? Is there a ...
1
vote
1answer
57 views

Video Feed via TCP Socket

I managed to send video feed over tcp socket using code and decode of string64. My problem is that the video feed is kinda laggy, and it's probably because of this time between coding and decoding. ...