As of May 31, 2023, we have updated our Code of Conduct.

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
1 answer
94 views

Login system using callbacks in android

I wrote a login system for an app I am developing, but I'm not really happy with the code I have at the moment. I feel like there is a better way at tackling a problem like this. In particular I'm not ...
RuuddR's user avatar
  • 121
4 votes
1 answer
116 views

Proper Error handling when we expect results from secondary functions

I'm building an android application and I have some second thoughts on some error handling case. I have a method that gets data from the internet by calling this method: ...
CDrosos's user avatar
  • 222
2 votes
1 answer
79 views

Android text to speech app

Since I am trying to learn many programming languages, I created this simple Android app. What it does basically is taking a sentence phrase from an EditText ...
user10191234's user avatar
2 votes
0 answers
281 views

Custom MediaController with full screen video image option

I have overridden setAnchorView() of MediaController class to display full screen option icon using below code.The code seems to be working fine in devices I tested but I have few doubts for which I ...
Android Developer's user avatar
2 votes
0 answers
923 views

Generic RecyclerView Adapter in Kotlin

I've just finished implementing a Generic RecyclerView adapter in my Android app, written in Kotlin. BaseAdapter.kt: ...
milancodes's user avatar
-3 votes
1 answer
52 views

I am trying to save a string to a MYSQL table from a radiobutton in java/Android studio [closed]

I am trying to save a radiobutton string if it clicked. I am making a survey where I need to save a "yes" or "no" into a MYSQL table using volley. I am having a little trouble ...
Connor Daly's user avatar
3 votes
1 answer
484 views

Displaying Video file from storage with MediaStore in android Java

I Used MediaStore to scan and display media files from my storage using below code ...
sanoj lawrence's user avatar
2 votes
0 answers
132 views

No hardcoded path

Since i develop in Java, i got into the habit of not putting hardcoded text in my code. For paths to files and folders I use the code below. I did it in a way that it was easy to set up and quick to ...
Syxs's user avatar
  • 21
3 votes
1 answer
2k views

Correct flow between Kotlin, Realm and ViewModels using Coroutines

I'm stepping back into Android after being away from it for about a year. Trying to get an out of date app of mine back on its feet, and continuing work on it. The app was written using Java, MVP, ...
BHogan's user avatar
  • 31
3 votes
1 answer
133 views

Finding the type of number entered by the user

I am making a fractions calculator that can calculate fractions, whole numbers and mixed fractions. So there is a String fraction, which is the input. Also, the user will enter the fraction in a ...
DeathVenom's user avatar
1 vote
1 answer
60 views

Renaming and deleting video file

I am using below code to rename and delete video. Need review for the following: Code optimization Performance Overall code review ...
Android Developer's user avatar
1 vote
0 answers
97 views

Multiple functions to run SQLite queries and save the output to a variable

I am building an Android quiz app. I want to display a progress bar showing how many questions a user has answered correctly and how many they have left. Questions are split by difficulty level; easy, ...
c_n_blue's user avatar
4 votes
1 answer
290 views

Code for sorting items in recyclerView

I'm have recyclerView which is needed for displayed for show list of my audio records. I added the ability to sort my audio records. Please take a look at the code that I use for sorting and tell me ...
Destroyer's user avatar
  • 427
1 vote
2 answers
604 views

Adapter for RecyclerView with supported onClick handling and select color text on last clicked item

I have written an adapter for RecyclerView. It can handle onClicks for RecyclerView items and select the color name and edit <...
Destroyer's user avatar
  • 427
1 vote
1 answer
150 views

Cycle through an array of available colors repeatedly

I have an array of colors for my app to choose from. My goal was to have the app cycle through the array of colors, apply it to my object, and reset to the beginning once each color has been used. ...
primelf's user avatar
  • 113
2 votes
2 answers
111 views

List Filtering Code

I am developing applications for android. In my application, the user can add information about his weight and watch the progress of weight change. I decided to add filtering of the elements according ...
Destroyer's user avatar
  • 427
3 votes
1 answer
329 views

A thread-safe typed Promise implementation in Java for Android

Introduction I've created a typed Promise implementation in Java for Android, borrowing ideas from this article for a JavaScript implementation, by Forbes Lindesay. To allow for "asynchronicity", my ...
Codifier's user avatar
  • 178
2 votes
1 answer
75 views

Code for adding a user to the database

I have a code that adds a user to the database, getting the username from the dialog.My fragment implements the interface with the onInputSend method, which is called by the dialog when the user ...
Destroyer's user avatar
  • 427
4 votes
1 answer
112 views

Scheduled Notifications (First Android App)

I'm happy to present my first Android project, which collects market index data (three Asian indices) and fires a notificaiton every Wednesday, Thursday and Friday at 7:30 AM displaying the data. I've ...
ola_bandola's user avatar
2 votes
1 answer
42 views

Class for user actions

I implemented a class for relationships with the user (deletion, name change, check for existence), I created this class to remove extra logic from the activity class. Could you talk about how my code ...
Destroyer's user avatar
  • 427
1 vote
0 answers
49 views

Android single activity app structure for smooth ux

I have an app that has only one activity and 5 fragments. I removed the navigation component because it was buggy and restored the old navigation, which is simply a ...
Mointy's user avatar
  • 131
3 votes
1 answer
126 views

Change layout in Gridlayout runtime

I'm trying to change the GridLayout of my application in runtime, the user can select 1, 2 or 3 columns for his display. To do that I've used a ...
Biscuit's user avatar
  • 131
5 votes
2 answers
118 views

Code to support different measurement systems

I am developing an application in which the user can use different measurement systems. Currently, there is support for the metric and imperial measurement systems. To support these systems, I wrote ...
Destroyer's user avatar
  • 427
1 vote
0 answers
44 views

Custom view to select a value

I created a Custom view to select a value. I use horizontal Recyclerview to select an integer value and 2 buttons that decrease or increase the values. Could you consider the code and tell how it can ...
Destroyer's user avatar
  • 427
2 votes
1 answer
53 views

moving player right or left depending on swipe

In my Player.java class, I want to incorporate a function that moves my player according to the left or right swipes. I also used time in seconds in order to vary the movement in an cyclic way: ...
aqw's user avatar
  • 23
2 votes
2 answers
53 views

Does iterating through a large data set in a Map each time i click impact the performance?

I need to get values from a Map by Adapter position i get from a RecyclerView. As you can see each time i click on an Album Art i create a new array of album objects. ...
Vince VD's user avatar
  • 121
2 votes
0 answers
598 views

Java's AtomicInteger equivalent in c#

I'm trying to replicate Android's GenerateViewId() to assign a unique Tag to dynamically created UIViews in Xamarin.iOS. ...
Olivier MATROT's user avatar
3 votes
2 answers
117 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 ...
Destroyer's user avatar
  • 427
1 vote
0 answers
63 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 ...
Destroyer's user avatar
  • 427
1 vote
2 answers
52 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 ...
CDrosos's user avatar
  • 222
-2 votes
1 answer
51 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 ...
CarlosDnl's user avatar
3 votes
1 answer
148 views

Loading 300 images on a custom spinner with images

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 (all images are within the app). Is this a ...
CDrosos's user avatar
  • 222
2 votes
2 answers
151 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 ...
Destroyer's user avatar
  • 427
7 votes
1 answer
1k 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 ...
Deyvidoes's user avatar
2 votes
0 answers
96 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 ...
Dani Nuñez's user avatar
1 vote
1 answer
85 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 ...
Simson's user avatar
  • 277
1 vote
0 answers
38 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,...
Manuelarte's user avatar
3 votes
1 answer
132 views

Android - Simplify ViewModel and Repository classes with OOP

Let's say I have 2 repository classes: ...
Mertcan Seğmen's user avatar
2 votes
1 answer
53 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 ...
GalaktycznyRychu14's user avatar
1 vote
0 answers
63 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 ...
Xer007's user avatar
  • 11
3 votes
3 answers
142 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 ...
Rob's user avatar
  • 63
1 vote
2 answers
41 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 ...
vico's user avatar
  • 111
5 votes
1 answer
205 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 ...
JarsOfJam-Scheduler's user avatar
1 vote
0 answers
97 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 ...
Jason p's user avatar
  • 21
1 vote
1 answer
1k 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 ...
JarsOfJam-Scheduler's user avatar
0 votes
1 answer
82 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. ...
John Casey's user avatar
1 vote
2 answers
72 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: ...
Cliff Burton's user avatar
1 vote
1 answer
359 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. ...
ysfcyln's user avatar
  • 121
1 vote
1 answer
45 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 ...
cantona_7's user avatar
  • 133
6 votes
1 answer
275 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 ...
eliranno's user avatar

1
2
3 4 5
17