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
4
votes
0answers
25 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 ...
5
votes
1answer
132 views
+50

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? ...
1
vote
0answers
30 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
24 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
98 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: ...
1
vote
0answers
27 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
57 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 ...
1
vote
0answers
77 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
63 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
72 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
102 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
91 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
47 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
25 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
89 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
53 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
43 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
94 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
154 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
64 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
63 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
33 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
33 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
101 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
86 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
105 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
38 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
70 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
147 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
74 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
68 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
92 views

Android - Simplify ViewModel and Repository classes with OOP

Let's say I have 2 repository classes: ...
2
votes
1answer
47 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
54 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
43 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
110 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
38 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
98 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
40 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
125 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 ...

1
2 3 4 5
16