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

Android Code - First Kotlin Project

I am learning Kotlin for Android dev. I do not have anyone to review my code and give feedback. Please review the following project and let me know how I can make it better in terms of scalability if ...
1
vote
1answer
42 views

UDP image livestream from Android device to C# desktop application

After searching a lot, on how to do it and not finding any good solutions, I implemented my own UDP livestream from an Android device to a C#/WPF desktop application. It works, however, since I get ...
-2
votes
0answers
11 views

A class for full-text search the whole database [closed]

I'm writing an Android app that can search the whole database. More specifically I'm using Room (an abstraction over the in-app SQLite database) and trying to sticking to the official App architecture ...
0
votes
0answers
12 views

How does one handle activity stuff in custom classes in Android?

This is a question, I'm just not quite sure about: Every Android development tutorial you find, will put all of the code simply into the MainActivity class (or some ...
0
votes
0answers
12 views

Using Autofac with static services class

I am using Autofac to maximise the sharing of code between Android and iOS via a shared PCL assembly in a Xamarin (native) environment. The shared service layer consists of four interfaces to classes ...
2
votes
1answer
26 views

how to efficiently draw line numbers in edittext ondraw without causing lag in scrolling

I have an implementation of an edit text to show line numbers and also highlight the current line. I think it needs more optimization because when I scroll through the edit text with about 500 lines ...
2
votes
1answer
30 views

Easter date calculator Android application

Since Easter holidays are close, I have decided to develop my Android skills by writing an Android app that calculate that date for the Western and Easter calendars. The formulas were gotten from the ...
0
votes
0answers
17 views

Best practice to change item based on RoomDB value before inserting it using Kotlin

In my App i use Room database and i have three tables where two of them are connected. The app just save the user input and insert it in the database. The user actually just insert as input a code and ...
2
votes
1answer
42 views

Generating multiplication questions and answers for a quiz style app

See this link for previous post on this subject 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 ...
0
votes
0answers
20 views

How to effectively sperate CRUD operations from the main SQLiteOpenHelper - android studio

I'm conflicting about how I want my database architecture to be built. First of all, I use a singleton pattern for the database in order to insure one instance of it (so its thread-safe), and also for ...
1
vote
1answer
96 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
37 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
40 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
32 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 ...
0
votes
0answers
76 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 ...
3
votes
0answers
368 views

View Binding with Base Classes

UPDATE: After getting "a kind of" affirmation from various platforms( my discussions on twitter, reddit, other stack overflow posts,etc) I have written an article on this style of view ...
3
votes
1answer
477 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
28 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
187 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
74 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
78 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
100 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
63 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
67 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
463 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
96 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
81 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
495 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
100 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
40 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
135 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
77 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
45 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
97 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
162 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
86 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 ...
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
40 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
36 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
104 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 ...
1
vote
0answers
41 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
202 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
107 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 ...
1
vote
0answers
58 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
2 3 4 5
17