The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [android]

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

138 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2
votes
0answers
351 views

Setting preference summary

I'm taking and Android course and I would like to refactor the code for one of the exercises. The complete solution done by tutors is here. When I was doing this exercise by myself I was annoyed by ...
2
votes
0answers
41 views

PopupMenu implementation that hacks inflating a @MenuRes

Summary Usage will ask for a Context and a @MenuRes and then use the ...
2
votes
0answers
1k 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 ...
2
votes
0answers
69 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 ...
2
votes
0answers
8k 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 ...
2
votes
0answers
145 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' ...
2
votes
0answers
197 views

Checking authentication status by looking for a cookie

I'm an Android newbie. I have this function in my code: ...
2
votes
0answers
2k views

Handling Firebase's asynchronous calls Android

I have written a helper class to manage callbacks from Firebase's asynchronous calls. Can this be implemented in a better way? ...
2
votes
0answers
106 views

Randomizer App as Decision Maker

I am a newbie and self taught in programming. This is my first attempt to make app. Appreciate any input or comment to make my code writting skill better. https://github.com/snufflesrea/Decision-...
2
votes
0answers
368 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 ...
2
votes
0answers
55 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 ...
2
votes
0answers
157 views

Android app that listens for commands over a socket

I've just begun programming Java and I'm working on the following code that deals with socket-based communications. Basically it connects to a client on port 8888: Gist of code ...
2
votes
0answers
2k 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
279 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 inner-...
2
votes
0answers
258 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 ...
2
votes
0answers
297 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 ...
2
votes
0answers
828 views

Structured use of Android SQLite transactions

I got tired of following Android-SQLite's transaction idiom, briefly documented here. It requires too much boilerplate code, IMHO, especially when you add the obligatory null checks. So I came up ...
2
votes
0answers
97 views

Parallelized image transformations using GraphicsMagick

This is part of a script that I use for porting a TWRP theme from one resolution to another, respectively portrait to portrait and landscape to landscape. In this function entirely, it focuses on the ...
2
votes
0answers
2k views

Weather application code for API call

I have developed a simple weather application that provides the current weather report based on the city provided by the user. Can anyone help me to improve this code? ...
1
vote
0answers
20 views

Multiple Stopwatch App

I was fed up with the default alarm clock when doing laundry. The washing machine is in the basement and takes different time depending on the choosen program. The stopwatch has to be configured for ...
1
vote
0answers
19 views

Android: Fill a spinner data from the server dynamically

I'm new to android. How do you fill a spinner from the server's data dynamically. This is my Spinner layout: ...
1
vote
0answers
33 views

Functions to obfuscate and deobfuscate String. Am I missing out any edge cases?

I have 2 functions, which are going to hide/ unhide the multiple languages plain text. Security is not a major concern. The objectives are Just want to find a way to hide multiple ...
1
vote
0answers
99 views

Implementing std::filesystem::remove_all() for Android

I needed to use some c++ code on both standard Linux and the Android variant, and the code will use filesystem library but it isn't yet in the ndk. So I'm making a one to use on Android It will be ...
1
vote
0answers
39 views

Socket sending/receiving data

I am a beginner in Android and this is my first big project in it. I am trying to communicate with an STM Discovery board using an ESP01 module. Below is the client connection class ...
1
vote
0answers
17 views

Appium automated tests for manipulating checklists

I am new to automation. I have automated few test cases for a mobile app using appium and wanted to know the areas where my code can be improved further. ...
1
vote
0answers
104 views

Animated Button on Android using AfterEffects and Lottie

I have a question about my implementation of a "special" Next-Button. First I want to show you my AfterEffects file: So This Animation has 3 parts Green: Entry correct Red: Entry incorrect Blue: ...
1
vote
0answers
274 views

Retrieving date and time from Datepicker and Timepicker and then converting it to milliseconds

I currently have an Android Activity that allows the users to select the startDate, endDate, ...
1
vote
0answers
69 views

Getting Video file path from uri

I am using below code to get a video file path from uri. Need review for the following: 1.Code optimization 2.Crash(Code is working fine in the devices I tested but i need to make sure that it ...
1
vote
0answers
24 views

Reduce components in an android layout with GLSurfaceView

I would like to optimize this layout to improve rendering speed. How can I remove so many unnecessary components from the layout file? ...
1
vote
0answers
318 views

Wrap location API in coroutines

In my app I need to query location and scan wifi periodically. To conserve power I need to change the rate dynamically, depending on the distance to the target. Also I want to wait for both ...
1
vote
0answers
52 views

Android app to take a photos and show them in a gallery

Gallery will be displayed in RecyclerView. User can select some images and delete it with one button. It all works, but i think I have bad code, because I don't use some instruments (like fragment). ...
1
vote
0answers
19 views

Encapsulating simple license backup to a disk

I am enapsulating my license backup to disk, using an interface ILicenseProvider and the implementation is DiskLicenseProvider. Also i am throwing an unchecked exception LicenseProviderException which ...
1
vote
0answers
1k views

LiveData, MVVM and Repository Pattern

Is this a good approach or I've just found a nasty workaround? I'm using MediatorLiveData class because seems useful to update the source of a ...
1
vote
0answers
27 views

Making a lot of similar looking views in Android layouts

I'm getting started with Android development. Take a look at this Android layout file: ...
1
vote
0answers
19 views

Differ returned web link from app scheme

I have a WebView, which loads the returned from a request url. The thing is, the url might ...
1
vote
0answers
309 views

Utility Class for location functionality on Android using Google Play Services FusedLocationProviderClient API

I'm new to Android development and this is my first request for a code review. Constructive criticism is very welcome! I've written a class to wrap interaction with Google's ...
1
vote
0answers
57 views

Consuming APi using Rx in an MVP project

I would like to have some input here if possible, this code should make a request to an API and the call should return the desired object. The client to make the requests was made with Retrofit and ...
1
vote
0answers
80 views

Correct Callback for each item

I have added a correct question callback for different types of questions like: radio, checkbox and descriptive.. QuestionListActivity.class (it shows the list of questions to attempt) ...
1
vote
0answers
22 views

Conditionally perform asynchronous actions with RxJava

This seems to work fine however I'm sure there must be a neater way. The outcome should be: If isHidden == true then call canHideAccount. canHideAccount returns a Single. If isHidden != true then ...
1
vote
0answers
426 views

Android - perform an action in background every few minutes

I've written the code to perform some action every 5 minutes, regardless if the application is currently on the foreground or not. I'd like to get a feedback about correctness - have I chosen the ...
1
vote
0answers
58 views

Pushing a value to a Processor on a separate thread

I am attempting to use Room along with a full-text search (FTS) table. The issue is that Room doesn't recognize or support FTS tables. Though there is a work around for this; you just create the FTS ...
1
vote
0answers
53 views

Basic Java Android app for computer data logging in an SQLite database

This is a pretty basic app I made to collect data necessary for a separate project. However it's also my first go at doing any Android programming, so I know there's definitely issues with it (the ...
1
vote
0answers
67 views

Subscribing to multiple sources in RxJava

I have used RxJava to Observe multiple sources and then perform action depending upon values of Observables. I want to know if it can be further simplified. Goal: Complete implementation of RxJava. ...
1
vote
0answers
85 views

Sending data to an API with Retrofit 2.0

In my application, I want to post the version name and manufacturer name to a server using retrofit. Are there any bad parts in the code below? POJO: ...
1
vote
0answers
968 views

Using Asynctask with MVP architectural pattern

I am working on a simple android app to learn MVP. I am using synchronous OkHttp with AsyncTask for retrieving data from a REST ...
1
vote
0answers
97 views

Linear search on array

I've recently used this block of code from a quiz app where I check an array for the correct answer that was received from the browser and sent to the mobile device/application. ...
1
vote
0answers
49 views

Android application using RecyclerViews to list games in a Fragment

I am implementing MVP architecture, code works fine, I wanted your suggestions if I there can be improvements done or in any areas where I am not following the pattern correctly. It is a simple ...
1
vote
0answers
174 views

Setup tracking of user's location

It is hardy believable how complicated it is to get an app running which tracks the location of the user. ...
1
vote
0answers
124 views

Android login with strategy pattern not using command pattern

I have login code that I'm working for my social network. I am wondering if this is good coding standards or if there is some modifying I should do. Can anyone explain what can be done? Here is the ...
1
vote
0answers
48 views

Android continually run api request

What is the best practice to run continually api request, like every 1-10 seconds. Currently I am doing this which is not a good practice I think, it probably causes some overhead: ...