Skip to main content

Questions tagged [android]

Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com

114 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6 votes
0 answers
198 views

Converting between cooking measurements

I've made an Android app that converts between cooking measurements, taking into account the type of product you use (that way it can convert between mass and volume by using the density). What are ...
Jeroen Vannevel's user avatar
6 votes
0 answers
116 views

Android component animatable on its height

I'd like to have a code review for a component which is supposed to be animatable on its height. It's supposed to be a transitioning element. I find it quite laggy on my phone. ...
Astyan's user avatar
  • 79
5 votes
0 answers
2k views

Android nested RecyclerView handling clicks, using OOP

Brief Background: I just started learning Android Development recently. I have some experience with programming and understand the basics of OOP but am not confident that I am using principles of OOP ...
Ricky's user avatar
  • 51
5 votes
0 answers
60 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 ...
Abc Def's user avatar
  • 51
5 votes
0 answers
2k views

Android audio recording using AudioRecord and ByteBuffer

I'm developing an audio recorder app for android using AudioRecord class to have a low level access to audio samples. ...
jalal's user avatar
  • 51
5 votes
0 answers
138 views

Writing service/network layer for mobile apps

I have an app that gets and posts blog posts to and from a server. Right now I have a network client object which is passed into a service object. The service object is created and called from an ...
Matt's user avatar
  • 183
5 votes
0 answers
14k views

Using the same RecyclerView.Adapter with a different ViewHolder

I would use the same RecyclerView.Adapter with two or more different fragments. Every fragment uses a different view items layout so I must use a different ...
Dave's user avatar
  • 111
4 votes
0 answers
2k views

Android APP connect to FTP server in Java

I am attempting to build an Android APP with the ability to connect specified FTP server in Java. The connection operation has been performed in FTPconnection class ...
JimmyHu's user avatar
  • 5,214
4 votes
0 answers
2k 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 ...
ansh sachdeva's user avatar
4 votes
0 answers
222 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 ...
vt-dev0's user avatar
  • 183
4 votes
0 answers
905 views

Wrap location API in coroutines

In my app I need to query location and scan wifi periodically. To conserve power I need to change the rate dynamically, depending on the distance to the target. Also I want to wait for both ...
leonardkraemer's user avatar
4 votes
0 answers
4k views

Updating the UI without leaking the context after an Android AsyncTask finishes

In the past I always did AsyncTasks as private inner classes. The tutorials I found still recommend this (see here, here, here, and here). However, this has the potential to leak the context. Now ...
Suragch's user avatar
  • 405
4 votes
0 answers
287 views

Trying to avoid null types using lazy and lateinit Kotlin

I am using Kotlin from quite some time now, but I could not able to achieve not-null types for all the properties in Kotlin. After what I learned by watching Kotlin in Google IO and a bit of research,...
Sai's user avatar
  • 171
4 votes
0 answers
4k views

Creating Android layout with GridLayout

I'm trying to create a Layout with two columns which are next to each other (I'm accomplishing this behavior with a LinearLayout). Inside each column, I have two TextViews and two Buttons, which I ...
Larpee's user avatar
  • 143
4 votes
0 answers
148 views

Dynamically creating login screen on Android devices

This has been an experience. I'm well above "hello world" java is not a language I use often when programming and I don't program too much. I find myself a lot on Google.... basically just about for ...
Nolan Robidoux's user avatar
4 votes
1 answer
125 views

Porting a web-based POS system to Android

I'm currently porting a web-based POS system to Android. The Android version uses NavigationDrawer to navigate between menus. What I need a code review on is my ...
TtT23's user avatar
  • 1,040
3 votes
0 answers
47 views

Trying to properly modelize app settings in a MAUI app following MVVM architecture

Context: I am working on a relatively simple MAUI app, which includes a Setting page allowing to customize the UX/UI of the app. I am trying to make the best use of the functionalities of MAUI, while ...
Toto's user avatar
  • 131
3 votes
0 answers
129 views

MVVM signing in using firebase

I'm new to MVVM architecture. I want to have authentication with email + password, google and Facebook. I'm not sure if there should be separate view models for each authentication way: ...
Edziu Kowalski's user avatar
3 votes
0 answers
1k views

Jetpack compose login screen + ViewModel

Im working on the login screen for my application. It has fields for users email and password. Also users can click on forgot password button to send an email with new passsword. It can validate these ...
Destroyer's user avatar
  • 477
3 votes
0 answers
298 views

Android BMI calculator using LiveData

I have made a Body mass index-calculator using ViewModel and LiveData. Source-code of the MainActivity: ...
michael.zech's user avatar
  • 4,358
3 votes
0 answers
987 views

Android APP FTP downloading file implementation in Java

This is a follow-up question for Android APP connect to FTP server in Java and Android APP FTP uploading file implementation in Java. I am attempting to perform the download operation to specified FTP ...
JimmyHu's user avatar
  • 5,214
3 votes
0 answers
948 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
0 answers
98 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
3 votes
0 answers
1k views

Android+Firebase testing using Mockito

I have an interactor/usecase class in my application. My application follows MVVM architecture with interactor/usecases responsible for logic (e.g. get data from api-service, store in local-database ...
CJR's user avatar
  • 151
3 votes
0 answers
47 views

Load all data from cursor

I have a Db table: 'aid' INTEGER, 'tid' INTEGER, Which represents connection between activity and task, so multiple tasks could be connected to one activity ...
Oleksandr Albul's user avatar
3 votes
0 answers
114 views

Java Android Sudoku solver

I made a simple and non recursive Android Java Sudoku solver implementing Algorithm X with links inspired from dancing links. The code is on Github (start with the Solver class and the ...
Pierre Gillet's user avatar
3 votes
0 answers
71 views

Listing YouTube videos using API with RxJava

I am new to RxJava and have the following code which I use to search YouTube videos via the API and ultimately display them in a list. ...
Adam's user avatar
  • 321
3 votes
0 answers
448 views

Timer application in MVP

I create simple Android timer application and I try to use MVP design pattern. I read some tutorials and after that I started writing code. My code is working correctly and as intended. There is ...
ostojan's user avatar
  • 151
3 votes
0 answers
821 views

Endless scroll in kotlin (android)

This is the code of my function to endless scrolling. It's a good practice to bind new disposable in onscroll listener? What do you think about my code? ...
KarolDevz's user avatar
3 votes
0 answers
2k views

Putting thread in sleep while waiting for BroadcastReceiver

I'm a little puzzled about a procedure inside my Android app. It's actually working but it looks like bad practice and probably it lowers performances. Short explanation: I'm running a separate ...
fillobotto's user avatar
3 votes
0 answers
266 views

Search GitHub users when text field changes in Kotlin Android app

Problem: Search for users by their name using the GitHub API (sorted by the number of followers) and display the results in a RecyclerView. Implementation: Hitting the GitHub API every time when user ...
Ankur_009's user avatar
  • 131
3 votes
0 answers
153 views

BDD on Android with Kotlin

I am considering an approach fo BDD tests on Android. The sample app — a simple messenger — has been made in Kotlin, so will be the tests. I ended up with something like this : ...
Gorcyn's user avatar
  • 131
3 votes
0 answers
115 views

Loading image/texture sprites on GameScreen in LibGDX

I'm new to this framework, LibGdx. I need advice/suggestion for my game. Is it okay if I load my images in a single class? I'm a beginner and started learning LibGdx. I already coded my game screen ...
zarawayun's user avatar
3 votes
0 answers
837 views

Convert Unicode text to font glyphs for display on Android devices

Prior to Android 6.0, Mongolian text is not supported on Android devices. And as far as I know, OpenType smart font rendering is still not supported. Therefore, in all my Mongolian apps I use a ...
Suragch's user avatar
  • 405
3 votes
0 answers
393 views

Setting preference summary

I'm taking and Android course and I would like to refactor the code for one of the exercises. The complete solution done by tutors is here. When I was doing this exercise by myself I was annoyed by ...
alexpfx's user avatar
  • 514
3 votes
0 answers
5k views

A BaseActivity to render toolbar and navigation drawer

I'm new to Android programming and this is my first project so I'm not sure if this is the correct method of rendering the toolbar or the navigation of the drawer on the screen: So I have a ...
Areeb Beigh's user avatar
3 votes
0 answers
790 views

Tablayout code for Android

I am using Tablayout for an Activity in my app but for some reason icons for each tab using ...
Shafayat Mamun's user avatar
3 votes
0 answers
70 views

Easily add Accessibility to your app as an afterthought. Yes, as an afterthought

Accessible apps allow more users to use your app; however, it is usually an afterthought for developers, and it makes your XML layout files messy whether Accessibility was a forethought or ...
Christopher Rucinski's user avatar
3 votes
0 answers
207 views

Animation for android ImageViews acting as game pieces

My question is about how to achieve a well-performing animation for a set of ImageViews, so that the foreground fades away and the background stays the same. ...
Bö macht Blau's user avatar
3 votes
0 answers
129 views

Getting contacts from phone is taking too much time

I am working on an instant chat messaging application. I am getting contacts from phone and displayed them in list view of an activity, but it is taking 25-30 seconds using the following code: 1. On ...
Deepak Rattan's user avatar
3 votes
0 answers
380 views

Hourglass path in SVG for Android

I've created my first Android drawable, a hourglass shaped image, and I'm curious what can be improved with it. It seems weird having to use 4 paths, but I couldn't get it to work any other way. ...
TMH's user avatar
  • 499
3 votes
0 answers
1k views

Map Events From calendar provider to dates in gridview

I working on a calendar app on Android, using roomaorama, which is nice. I am fetching all the events from Events table in Calendar provider once which seems not good performance wise. The library ...
Raghunandan Kavi's user avatar
2 votes
0 answers
204 views

Flutter Cubit: 2 Screens and Listview

I try to program a small app to track my cost spendings. As state management I use Cubit. As I am a flutter beginner, I wanted to verify if I implemented it correctly. The UI consists of 2 screens: 1 ...
Rasputin221's user avatar
2 votes
0 answers
178 views

Android architecture and dependency injection of domain layer usecases

I am implementing some of the architectural designs from Google I/O's app to my own app, but I have come across something in their app that has created some confusion for me. They have a domain layer ...
CJR's user avatar
  • 151
2 votes
0 answers
210 views

running a task on UI every x seconds

I often come around a requirement where we have to perform a repetitive task on the user's screen (for eg, updating a counter like flash sale/ live class timer, autoscrolling the banner, etc) . I have ...
ansh sachdeva's user avatar
2 votes
0 answers
60 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). ...
UnknownError's user avatar
2 votes
0 answers
389 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
196 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
2 votes
0 answers
743 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. ...
user avatar
2 votes
0 answers
151 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 ...
nullmn's user avatar
  • 121