Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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

SharedPreferences singleton wrapper

I was wondering wether my implementation of the PreferenceService below is thread safe or could cause memory leaks. Android Studio gives me the warning "Do not place Android context classes in ...
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 ...
2
votes
1answer
71 views

Populate an ArrayList of different instances of a class

First of all, here is an overview of my application. I want to create a multiple-choice app, on android, using data stored on a remote MySQL database. The DB has 100 questions that will appear in ...
4
votes
1answer
57 views

Android Java Splash Screen code

Here's my android splash screen. I am trying to figure out a better way to write it. It just moves the logo up to the center of the screen. It's my third time creating a splash screen for an android ...
3
votes
1answer
43 views

Code feedback on running app

I have made an Android app called RunTracker - https://github.com/michaelnares/runtracker/tree/master/app. The intended functionality is that the app saves runs to the local filesystem, shows your ...
2
votes
1answer
65 views

Creating an empty Sudoku grid

I am generating a 9x9 grid on which I will play sudoku later by setting click listeners to each square on the grid. I first have a .xml file that represents a single square in the grid. This consists ...
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
1answer
45 views

Simple function to Http GET some data

This is within a base class of a library, where several other classes inherit this one. This seems like the simplest way of just getting some data, for now without timeout/errorhandling. This is ...
0
votes
0answers
19 views

Load data from server to populate in spinner

I'm learning ROS and I'm trying to populate data from my server to spinner. my JSON is: ...
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 ...
3
votes
0answers
50 views

Getting a list of waypoints assuming that there is a map [closed]

I'm a beginner learning ROS. I'm developing an android application that will control my robot and that includes getting the list of waypoints to display it to my spinner. How do you get the list of ...
1
vote
1answer
87 views

Night out with friends. Calculating the costs per person with Kotlin and Android

The following app basically sums up the costs for an evening and calculates the costs per person. The user can input the description of the costs [String] (for example, round one = Spare Ribs Place, ...
2
votes
1answer
60 views

Kotlin shared preferences

So I've written a class for storing user/device specific settings, but I've written the Kotlin pretty much like I would in Java: ...
2
votes
1answer
54 views

Creating many Android cardViews with different background colors [closed]

I have cardView in my android app with three child component. I set the background color for each components. Based on card INDEX I reset the background colors individually. If it's just one cardView ...
2
votes
0answers
41 views

Upload to FTP method for Android that mimics the command line mv

I've created a Java class for Android that connects to a FTP server (using the FTPClient library from commons-net-3.6) and ...
2
votes
1answer
68 views

ViewModels for image transformations

In my project I have a chain of Fragments where each one gets a bitmap, manipulates it, then sends it to another fragment for more processing. My fragment chain looks like this: CaptureFragment -> ...
2
votes
0answers
34 views

Updating UI in Retrofit onResponse

I have an Android project that queries the BART train API. I was curious if updating the UI inside the Retrofit onResponse method is correct or if there is a better way. Below is my code. Also, here ...
1
vote
1answer
50 views

Kotlin Android request client

As part of an android app, I've written a simple wrapper that makes requests to an api and fetches stuff. ...
2
votes
0answers
27 views

Google Play billing + Firebase functions: Creating a one-time product, server-side

My Android app must request my Cloud Functions server to create in-app products at runtime ; then, the server responds with the created one-time product. I've written the server Cloud Function that ...
1
vote
1answer
45 views

Data class where i need to set values for different fields at different times

I am creating a request for an api using below class- ...
1
vote
1answer
77 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
34 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 :...
1
vote
1answer
57 views

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 ...
2
votes
0answers
42 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 ...
0
votes
0answers
31 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
76 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
92 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
50 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 ...
1
vote
1answer
44 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 ...
5
votes
1answer
59 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 ...
4
votes
1answer
86 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 &...
2
votes
0answers
115 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 ...
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 ...
5
votes
0answers
154 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 ...
4
votes
2answers
61 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 ...
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 ...
2
votes
0answers
60 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
64 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 ...
3
votes
0answers
38 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 ...
2
votes
1answer
104 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 ...
2
votes
0answers
30 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
92 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
53 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. ...
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 ...
2
votes
1answer
63 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 ...
3
votes
1answer
78 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
1answer
173 views

Destroy Singleton pattern 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 ...
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. ...
0
votes
1answer
58 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 ...
0
votes
0answers
60 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. ...