Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com
0
votes
0answers
7 views
Trouble accessing SQLite database for my android app [on hold]
I'm having some code issues with my android app. I'm trying to get a few edit text boxes to create a term object in my database whenever I click the add button. I then want my ListView to reflect my ...
0
votes
0answers
6 views
Fetching meta-data from the AndroidManifest.xml in a fragment
I'm creating a YouTubePlayerFragment inside of a fragment. When initialising the player I need to pass an API key to it. So I end up with something like this:
<...
-4
votes
0answers
16 views
Cordova Native Page Transitions issue [on hold]
I been using the Native Page Transitions for phonegap for a while but I always had problems adjusting the timer to make a smooth transition cross device.
For those not familiarized with the plugin, ...
-1
votes
0answers
14 views
Can't parse date correctly from edittext in android [on hold]
I'm trying to parse a date from an EditText in android, to convert to another date format, but I can't get the correct day when I parse it. I only get the correct month and year.
This is my current ...
4
votes
0answers
58 views
Dynamically creating login screen on Android devices
This has been an experience. I'm well above "hello world" java is not a language I use often when programming and I don't program too much. I find myself a lot on Google.... basically just about for ...
-3
votes
0answers
40 views
UnitTesting retrofit network call
I am testing the sync network call via Retrofit.
I wonder whether the test below is good enough to determine if a call was successful or not?
As I have never written a test before, I also wonder ...
3
votes
1answer
54 views
Creating new async tasks
In the past, I have used AsyncTasks to perform network requests for my Android app. I recently switched to RxJava to be able to cancel the requests when the user exits an activity. I have created a ...
2
votes
1answer
44 views
Animation with orientation change of Android device
I've started my first "job" like 2 weeks ago, and to be honest I've received a quite hard task to do, since I'm beginner with Android, and quite fresh at programming. The thing I needed was to find ...
1
vote
1answer
54 views
ButterKnife.bind with super class
I am using ButterKnife in my project, and as we know we have to write ButterKnife.bind(this); in all the activities, so I have ...
-1
votes
1answer
39 views
0
votes
1answer
77 views
Singleton Design Pattern Implementation: Bill Pugh
I have been trying to implement the Bill Pugh Singleton Design Pattern using a private static class to return the singleton retrofit instance. So far I have been able to come up with the following ...
4
votes
1answer
60 views
Android “ServiceListener” class for listening web services
I'm new in Android, Java and the whole object-oriented programming, I'm trying to develop an app which needs to listen on many web services (PHP scripts written by me returning a standardized JSON ...
3
votes
1answer
36 views
Android Authentication Activity with Fragments
I have an Activity called AuthActivity and I would like all of my authentication Fragments to be in this ...
1
vote
1answer
38 views
Android UI for converting numbers from base system x to base system y
As a complete beginner, I didn't care about how the code looked as long as it works. However, now I am starting to think about how to make code be more maintainable and easier to read.
I feel I have ...
1
vote
1answer
59 views
Class with multiple parameters as the object of a WeakReference
I just read this post on how to avoid memory leaks with AsyncTask. The post proposed using a WeakReference and supplying a TextView as the object of the WeakReference.
In my code, I need to supply ...
2
votes
1answer
59 views
Completely static builder implementation
CustomClass.class
Description
The CustomClass is created with init(), which returns a ...
0
votes
0answers
56 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 ...
3
votes
2answers
68 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
271 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 ...
4
votes
2answers
81 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 ...
2
votes
3answers
137 views
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 ...
6
votes
1answer
50 views
ActivityLifecycleHelper implementation advice
Description
The ActivityLifecycleHelper uses wrap(Context)to create the class & save a global ...
3
votes
1answer
40 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
65 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
261 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
35 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
87 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
2answers
247 views
Returning a URL string of an API endpoint
I have a class with multiple methods which return a URL string of an API endpoint. Each method takes different parameters based on what the endpoint have to include.
Examples (among others):
GET: <...
0
votes
0answers
29 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
43 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
40 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
43 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 ...
2
votes
1answer
37 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
84 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
53 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
95 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
102 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 ...
0
votes
1answer
41 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
48 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
77 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
50 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
45 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
175 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 ...
0
votes
0answers
27 views
1
vote
2answers
133 views
ِAndroid 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 apps.
At first I get used to check permission by this way:
...
1
vote
0answers
34 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
106 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
58 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
239 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....