Questions tagged [android]
Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com
138
questions with no upvoted or accepted answers
6
votes
0
answers
115
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.
...
5
votes
0
answers
182
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 ...
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.
...
5
votes
0
answers
137
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 ...
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 ...
4
votes
0
answers
1k
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 ...
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 ...
4
votes
0
answers
55
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 ...
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 ...
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 ...
4
votes
0
answers
123
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 ...
4
votes
1
answer
122
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 ...
3
votes
0
answers
667
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 ...
3
votes
0
answers
1k
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
0
answers
203
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 ...
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 ...
3
votes
0
answers
45
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 ...
3
votes
0
answers
113
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 ...
3
votes
0
answers
888
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 ...
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 ...
3
votes
0
answers
285
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,...
3
votes
0
answers
108
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 ...
3
votes
0
answers
803
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 ...
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 ...
3
votes
0
answers
789
views
Tablayout code for Android
I am using Tablayout for an Activity in my app but for some reason icons for each tab using ...
3
votes
0
answers
66
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 ...
3
votes
0
answers
205
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.
...
3
votes
0
answers
126
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 ...
3
votes
0
answers
373
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.
...
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 ...
2
votes
0
answers
51
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:
...
2
votes
0
answers
570
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 ...
2
votes
0
answers
230
views
Android BMI calculator using LiveData
I have made a Body mass index-calculator using ViewModel and LiveData.
Source-code of the MainActivity:
...
2
votes
0
answers
282
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
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:
...
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 ...
2
votes
0
answers
599
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.
...
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 ...
2
votes
0
answers
147
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 ...
2
votes
0
answers
47
views
Upload to FTP method for Android that mimics the command line mv
I've created a Java class for Android that connects to a FTP server (using the FTPClient library from commons-net-3.6) and ...
2
votes
0
answers
586
views
Updating UI in Retrofit onResponse
I have an Android project that queries the BART train API. I was curious if updating the UI inside the Retrofit onResponse method is correct or if there is a better way. Below is my code. Also, here ...
2
votes
0
answers
89
views
Google Play billing + Firebase functions: Creating a one-time product, server-side
My Android app must request my Cloud Functions server to create in-app products at runtime ; then, the server responds with the created one-time product. I've written the server Cloud Function that ...
2
votes
0
answers
784
views
BASH script to obfuscate android/meterpreter payloads
I have written a little script that does a pretty good job of obfuscating android/meterpreter payloads. It will generate payloads or used supplied msf payloads while also injecting a custom icon. The ...
2
votes
0
answers
43
views
Custom Security for API access from server to mobile application
i am not the best at security but need a custom way to securely store personal identifiable information like name, address etc - Can i please have some feedback on this custom code, from my ...
2
votes
0
answers
84
views
Firebase login/registration process for a dating app
I am developing another bigger project, I want to try a simple DatingApp and currently I try to develop a Login and Registration Form. There is no special register / login button, the code will later ...
2
votes
0
answers
59
views
Sharing File (Content) without saving it before
I have a listview of PrivateFile objects which contain the fileId (int), fileName (String) ...
2
votes
0
answers
69
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.
...
2
votes
0
answers
431
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 ...
2
votes
0
answers
104
views
Yoga Android app
I have created a yoga app on Android Studio. Can someone review the code to see if I have used the best practices of programming?
MainActivity:
...
2
votes
0
answers
762
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?
...