Questions tagged [android]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
467 views

Android Tetris App Design

Recently I have finished my first bigger Android project. I made a little Tetris App. Here is a picture of my app in emulator: My Tetris has following functions: fast drop down play tetris music ...
1
vote
1answer
46 views

TCP server in Android to continuously listen to an RFID reader

I have created a TCP server thread which I want to keep running and listening to the IOT device (an RFID reader). I have only one client. Please review my code and provide your feedback. Are there ...
1
vote
1answer
33 views
1
vote
0answers
19 views

Android RecyclerView Popop Activity - 5 second popup time

So I've been working on a RecyclerView recently that's in a popup, and it takes a few seconds to popup with around 100 items. I want to make this faster, so any improvements on my code is appreciated :...
0
votes
1answer
36 views

Optimize code for a grid of radio buttons in Android

I want to display multiple radio buttons in a layout with multiline style as an item inside a RecyclerView. Look at the code I provided below and suggest how I can ...
4
votes
1answer
4k 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....
2
votes
0answers
24 views

BASH script to obfuscate android/meterpreter payloads

I have written a little script that does a pretty good job of obfuscating android/meterpreter payloads. It will generate payloads or used supplied msf payloads while also injecting a custom icon. The ...
3
votes
1answer
5k views

Efficient Album Cover loading for ListView

I have a list view which display in each view a Album's name, the associated Artist and the album art. Here is the code of my ListFragment which display this list:...
0
votes
0answers
24 views

Adapter for Spinner

I need to my spinner supported endless scrolling. As rule the user will have only 1 - 5 items but in very rare cases some users can have 100+ items that will be loaded from server by pages (15 per ...
0
votes
1answer
69 views

Optimize this code of adapter's overriden method getItemCount() [closed]

How can I optimize this code of adapter's overriden method getItemCount() into simpler form? ...
1
vote
0answers
24 views

Monitoring Services And Characteristics on React-Native [closed]

I have two questions for you about my code :) I'm creating an android to connect to ble device. I'm using ble-plx library. ...
2
votes
1answer
42 views

RecyclerView with different ViewHolder using generic

I have different ViewHolder for different Feed implementations. But I can't use the best practice of having each ...
0
votes
0answers
25 views

Android LiveData Shared between activities by Application Session

I'm developing an app that use socket to receive messages from a chat. I'm using an MVP approach and I store the data in a Singleton class named DataBridge like ...
2
votes
2answers
222 views

Call multiple asynchronous HTTP requests and wait for the result

I have a Repository class which looks like this: ...
2
votes
0answers
30 views

Android+Firebase testing using Mockito

I have an interactor/usecase class in my application. My application follows MVVM architecture with interactor/usecases responsible for logic (e.g. get data from api-service, store in local-database ...
3
votes
1answer
3k views

Android RecyclerView Adapter: Passing normal clicks and menu clicks over the same activity

I am unsure about my approach here. As you can see, I want to send normal clicks and 2 different menu item clicks back to the underlying activity over an interface. Now I wonder if it is bad practice ...
4
votes
1answer
50 views

Google Maps API - reading locations from file and displaying markers on map

I'm working with Google Maps and want to read in location objects into the map. I'm loading them in from a .csv file and create Shelter objects for each location that I save in an ArrayList. To ...
10
votes
1answer
543 views

ActivityLifecycleHelper implementation

Description The ActivityLifecycleHelper uses wrap(Context)to create the class and save a global ...
4
votes
1answer
80 views

Android clock in/out app

I am writing a clock in / out and payroll app for Android. I am no professional, but I was hoping I could get some feedback on whether my code is spaghetti or not. This is just one of many classes &...
4
votes
1answer
268 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
1answer
357 views

Storing realm objects using Kotlin extensions

I am a Java Android Developer and I'm approaching Kotlin. I have defined the following class: open class Player : RealmObject() { ... } And I defined the ...
5
votes
0answers
146 views

Converting between cooking measurements

I've made an Android app that converts between cooking measurements, taking into account the type of product you use (that way it can convert between mass and volume by using the density). What are ...
2
votes
0answers
36 views

Custom Security for API access from server to mobile application

i am not the best at security but need a custom way to securely store personal identifiable information like name, address etc - Can i please have some feedback on this custom code, from my ...
2
votes
1answer
171 views

Helper class for Fragments management

A Helper class for Fragment Management. The FragmentsManager class has methods to add and replace fragments. The replace method checks if the given fragment is present in backstack or not and if the ...
2
votes
1answer
2k views

Accessing Adapter data from ViewHolder

In my Android app, I need to disable a button in Layout if the api return status as 0. I get this status in the Adapter and based on it, I have disabled the button in ViewHolder which is inflating the ...
3
votes
2answers
109 views

Displaying 21 spinners to select body parts

I just wanted to ask how can I make my code a bit shorter. As of now, I have way too much code in the class. The program should display about twenty one spinners. I know it's a lot, but in this layout,...
4
votes
2answers
59 views

Android NDK Low performance

I am trying to write a NDK program for quicksorting an array. However, in my benchmarks C is doing consistently worse than Java, as indicated by my results: Java 1190625 C 1809218 Java 895104 C ...
4
votes
1answer
149 views

Initializing an Android activity by reading a CSV file with image IDs, names, and descriptions

I am using Java to create an Android app. I have the main activity read a CSV file, create objects, and then save them into a singleton class so the rest of the activities in the app can access them ...
1
vote
0answers
72 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 ...
0
votes
1answer
6k views

Password and confirm password validation in Android Studio

I just wrote this password and password confirmation validation code function that checks to see if a password is empty or not, and is it match (password = confirmPassword). I'm not sure this is the ...
2
votes
0answers
27 views

Sharing File (Content) without saving it before

I have a listview of PrivateFile objects which contain the fileId (int), fileName (String) ...
3
votes
0answers
34 views

Load all data from cursor

I have a Db table: 'aid' INTEGER, 'tid' INTEGER, Which represents connection between activity and task, so multiple tasks could be connected to one activity ...
1
vote
1answer
53 views

Optimize Multiple Insert SQLite Coming From MySQL

I'm currently developing an app that requires sending and receiving of data from android studio going to MySQL and then data coming from MySQL will be saved from the SQLite. I need advice on how to ...
2
votes
0answers
57 views

Firebase login/registration process for a dating app

I am developing another bigger project, I want to try a simple DatingApp and currently I try to develop a Login and Registration Form. There is no special register / login button, the code will later ...
-1
votes
1answer
63 views

How to divide a large method into 2 smaller methods [closed]

I have created a method that is responsible for the creation and the saving of memes. This is a huge mistake because now I need to use 1 of those functionalities (creating) for a different purpose. I ...
2
votes
1answer
75 views

Android Java Unit Testing model class

I'm trying to get familiar with unit testing. I never implement TDD previously, but I believe it's the best way to write software. So, here I'm trying to test my ...
1
vote
0answers
68 views

Java Android Sudoku solver

I made a simple and non recursive Android Java Sudoku solver implementing Algorithm X with links inspired from dancing links. The code is on Github (start with the Solver class and the ...
2
votes
0answers
47 views

Listing YouTube videos using API with RxJava

I am new to RxJava and have the following code which I use to search YouTube videos via the API and ultimately display them in a list. ...
2
votes
2answers
3k views

Android utils class

I have created a Utils class, which consists of progressDialog and AlertDialog: ...
1
vote
0answers
34 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 ...
3
votes
1answer
74 views

Sending and receiving of JSON data to and from Android Studio

I'm currently developing an app that requires sending and receiving of data from android studio going to MySQL and then data coming from MySQL will be saved from the SQLite. I need advice on how to ...
0
votes
0answers
73 views

Destroy Singleton patter in kotlin

I am practicing Singleton pattern in kotlin. It is a quiz app which has question tile with four options and one correctIndex. McqOldActivity.classs ...
0
votes
1answer
46 views

Simple Android Volley login request

I've made a simple login API request which gets a token as a response. I had to use Toast a few times. Is is possible to make it with only two ...
1
vote
0answers
16 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. ...
0
votes
0answers
51 views

Android - Notification service to handle background notification

PREMISE: I have zero knowledge of Java and Android development. I put this together in a couple of weeks. The code works. But I look forward to some feedback and to know how I can improve it. ...
2
votes
1answer
38 views

Method that Saves user text messaging draft [closed]

I am working on saving the text messaging draft of a user. The flow currently works but I am looking to make this block of code easier to read and smaller. Could anyone help me achieve this? ...
0
votes
1answer
40 views

Android TCP server that maps data to an object and sends it to a service

This is a code for an android thread. This is a tcp server and gets data from socket, maps it to an object and sends that object back to the main service. If there is anything I'm doing wrong or if ...
1
vote
0answers
92 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
155 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
1answer
91 views

Restoring the instance state of an SQLite quiz app in Android

The following class is the activity of a little SQLite quiz app, which takes care of showing the actual quiz. Other than that the app only has a starting screen. I want to save the instance state and ...