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
3
votes
2answers
79 views

Code for saving / loading a class object

As I was advised, I broke my code into 2 classes. Could you take a look at the repository class and report what problems this code has ...
0
votes
0answers
42 views

Code for creating a dialog for choosing a date

I have code that creates an AlertDialog to select a date by a user. I ran into a problem that this code began to take up a lot of space. Could you offer ideas on how to shorten this code / put it into ...
0
votes
1answer
21 views

Android - Running endless code in Foreground while using the app

Im making an application that i want to have the ability to send report emails with a frequency. daily, weekly or monthly. Now i want those emails to be sent only if the app is running and if the ...
-2
votes
1answer
42 views

Set backgroud color based around database call [closed]

I have the following method that only checks if a Sqlite database has data, but I don't like how the code looks ...
1
vote
1answer
49 views

Loading 300 images on a custom spinner with images

I would like to ask if this is a bad idea. I have a spinner that it has a custom layout with 5 imageviews and 1 textview I would like to load it up with 80 rows, so it will display around 300 images, (...
2
votes
2answers
130 views

Code for getting the coordinates of points on the chart

I am a beginner android developer. I am working on one of my applications. For this application, I wrote an algorithm that is needed to obtain data that is used to build a diagram. I have a list of ...
6
votes
1answer
113 views

Recyclerview Adapter for weather app - Makes API calls for each item

I have a weather app that allows the user to save Cities (with nickname and zip) into a room database. I'm using mvvm and livedata to observe the list of cities and update the recyclerview ...
2
votes
0answers
62 views

ANDROID - Receive and manage markers in Google Maps

Recently, I've received negative feedback of interview's test. They say that they need somebody with higher technical level, the quality of the task was not good enough. I upload it here, to request ...
1
vote
1answer
64 views

An app displaying items fetched from JSON, but I think maybe I'm not using best Android development praxis

I have been programming in various languages for a very long time, and this was one of my first attempts to build an Android app. Apparently this was not good enough for the challengee, could somebody ...
1
vote
0answers
26 views

Android Studio Autocomplete that creates a new entry if no entry selected

I want to use the android component autocomplete: https://developer.android.com/reference/android/widget/AutoCompleteTextView There are some possible values the user can select, but I also want that,...
3
votes
1answer
78 views

Android - Simplify ViewModel and Repository classes with OOP

Let's say I have 2 repository classes: ...
2
votes
1answer
42 views

ZooRater mobile app. This code is responsible for displaying and handling zoo dashboard. Need general advice

Context: gitlab link I know, it's a lot of code but I need your help ladies and gentleman. I'm not sure if I can ask for code review for the whole project so I just ask to review this activity. I ...
0
votes
0answers
50 views

Downloading large amount of data and storing on Android & iOS

So I have this API that downloads from our web service, but the we service sends it as a ZIP file instead of a json stream or something else. Now the files can get quite large butt they are not ...
1
vote
0answers
39 views

Game Level Unlocking Logic Java [closed]

I am making a quiz game and every time you complete a stage, the next stage will be unlocked. The Problem: When I am at Stage 3 and finish it, Stage 4 is unlocked. But when I feel like I want to ...
3
votes
3answers
95 views

Java regex and replaceAll to extract strings into objects

I have this method that creates book objects. I pass a list of strings (size 60000+) that contain the information of the book, the function then goes and extracts the information makes the book object ...
1
vote
2answers
37 views

Does using SharedPreferences drain resources?

I have created class that uses SharedPreferences to store and retrieve application settings. Is it good idea to access ...
5
votes
1answer
74 views

Cloud Function: Deleting from both Firestorage and Firestore in a kind of “batch”

I've written code that deletes a "post" the user has sent with my Android app. A "post" is made of an image (stored in Firestorage) named A, of a Firestore document named B which is the user UID (this ...
1
vote
0answers
23 views

Uses SeekBar to adjust the data displayed in UI from my Room database

I wrote code that takes the value of the progress bar in my Android app which influences what is displayed on the UI. If the user's progress bar value is above or below a certain number, data will be ...
1
vote
1answer
51 views

Starting an activity after 1000ms from a splash screen with Runnable and Handler().postDelayed

I have implemented a splash screen which is the main activity of my Android app. This splash screen shows an image, and after 1000ms there is an animation to show another activity's layout. The code ...
0
votes
1answer
66 views

Implementation of Conway's Game Of Life on Android

I ended up using 2x 2D arrays with a one element border around everything to simplify the kernel logic. ...
1
vote
2answers
60 views

Decrypt multiple 10Mb files with defined password

One operation of my Android project is to decrypt one file (chosen in a set of ~30 files for pagination1) of ~10 Mb each and I do this with the following: ...
1
vote
1answer
61 views

Notify observers when object attributes update

I have a Singleton manager class for managing request model and its attributes. My main aim is update object observers when some of the object attributes changes. ...
1
vote
1answer
30 views

Sending DTMF tones from dialpad

I have the following code which works perfectly fine. I am using the dial pad to set the number and also to send the DTMF tones. But I find the code to bit more repitive. Is there any better way to ...
6
votes
1answer
51 views

Design a native video buffer in C++ to be shown on android application and shared with other modules in native space and Java

I'm working on a design for a video buffer in C++ that will be used by many consumers both in the native library space(C++) as well as Java side using JNI. My Idea is the following: Have a buffer ...
2
votes
0answers
71 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
36 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
101 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
66 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
47 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
115 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
29 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
60 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
25 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
53 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
100 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
109 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
109 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
42 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
81 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
141 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
70 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
41 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
47 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
174 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
78 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
239 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
123 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
41 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
78 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
2 3 4 5
16