Questions tagged [android]
Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com
797
questions
-2
votes
0answers
13 views
android firbase code error cant fix it [closed]
Please i need help
i was Created this app
but this error didt want to Go on
can any one help me to fix this
i Searched on Youtube and other websites i realy cant fix it
please help me
...
1
vote
1answer
53 views
Generating mathematical questions and answers
I have an Android quiz app that I am building to learn kotlin / android app development. Here is an object I have which acts as one of many question builders.
Is there a better way of writing this?
<...
1
vote
0answers
32 views
Monitor room repository for livedata changes and update views
I have built a quiz app. It is my first project so the purpose is to learn app development at this stage.
There are two key things which I am wondering how to do better (the app is fully functional).
...
0
votes
0answers
22 views
Android: should I get network calls in viewmodel
I am using Retrofit to get data from API. I am doing it in view model like the following:
...
0
votes
0answers
15 views
http url connection with kotlin on android
I'm making an http call from an android app and want to have it reviewed for brevity and efficiency. It handles both success and error streams, by contract 200 OK is enforced (not 201 created other ...
1
vote
0answers
69 views
Is my Android Room SQLite migration code written without flaw, as I wish to have 0 impact on my existing users?
Currently, we plan to perform an intensive SQLite DB migration code in Android. We really want to avoid from having any bad impact (data corruption) on existing users.
Can anyone help me to take a ...
2
votes
0answers
49 views
View Binding with Base Classes
Another non-android wording of this question could be : "Implementation that Prevents a child class from using a value that child class itself provided to the parent class".
Requirement : I ...
3
votes
1answer
81 views
Alternative class to imitate AsyncTask class (deprecated) with Thread and Handler classes
As the title says, I have created an alternative class to imitate AsyncTask class (deprecated) with Thread and Handler classes but i feel uncomfortable to use it.(the app works fine with my class) Can ...
4
votes
0answers
27 views
Fragment of code with Android MVP that checks login credentials via REST API
I'm learning MVP for Android and am wondering if that piece of code that I wrote is correct in terms of this pattern or maybe is completely messed up.
I'm wondering if there can be return type other ...
8
votes
1answer
180 views
Scanning and indexing files video
I use the following method to scan and index video files and pass data to an array. I get video file duration, file name, files size.
Is there any better method, or do I need to improve?
...
2
votes
0answers
50 views
A better understanding for separation of concerns. Android; Kotlin
I am an Android developer with only 5 months of experience. I am still learning and trying to do my best.
Right now I am interested in concept of ...
2
votes
1answer
25 views
How to speed up drawing process of output from .tflite model
I have piece of code where I draw output from model pixel by pixel:
...
2
votes
1answer
75 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 ...
4
votes
1answer
99 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:
...
2
votes
1answer
58 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 ...
2
votes
0answers
63 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 ...
2
votes
0answers
219 views
Generic RecyclerView Adapter in Kotlin
I've just finished implementing a Generic RecyclerView adapter in my Android app, written in Kotlin.
BaseAdapter.kt:
...
-3
votes
1answer
39 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 ...
3
votes
1answer
75 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
...
2
votes
0answers
74 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 ...
3
votes
1answer
239 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, ...
3
votes
1answer
97 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 ...
1
vote
1answer
48 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
...
1
vote
0answers
27 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, ...
4
votes
1answer
95 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 ...
1
vote
2answers
56 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 <...
1
vote
1answer
44 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. ...
2
votes
2answers
95 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 ...
3
votes
1answer
156 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 ...
2
votes
1answer
65 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 ...
4
votes
1answer
65 views
Scheduled Notifications (First Android App)
I'm unbearably 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 ...
2
votes
1answer
39 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 ...
1
vote
0answers
35 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 ...
4
votes
1answer
35 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 ...
5
votes
2answers
102 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 ...
0
votes
0answers
39 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 ...
2
votes
1answer
35 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:
...
2
votes
2answers
46 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.
...
2
votes
0answers
137 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.
...
3
votes
2answers
106 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
56 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 ...
1
vote
2answers
39 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
47 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
...
3
votes
1answer
81 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 ...
2
votes
2answers
141 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
226 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
78 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
70 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
27 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
95 views
Android - Simplify ViewModel and Repository classes with OOP
Let's say I have 2 repository classes:
...