Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [android]

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

-4
votes
0answers
24 views

App crashes on First Open only when AdMob is added but working fine on next open [on hold]

My App is working fine and then I tried to add AdMob dependencies. That's when things get complicated. On first install and then open App crashes. But on second and consecutive open the app is working ...
2
votes
0answers
29 views

Card based game in Android

I am developing a card game in Android. This is my first time I am working in Android,. The game contains following features: It will be a 6 player game. There are two decks on the table, one with ...
-1
votes
0answers
11 views

process image using fresco on android then display it in draweeView [on hold]

How i can process an image from gallery gallery before displaying it in draweeView using Fresco. what i'm did so far was.. ...
1
vote
0answers
21 views

Getting Video file path from uri

I am using below code to get a video file path from uri. Need review for the following: 1.Code optimization 2.Crash(Code is working fine in the devices I tested but i need to make sure that it ...
1
vote
0answers
12 views

Reduce components in an android layout with GLSurfaceView

I would like to optimize this layout to improve rendering speed. How can I remove so many unnecessary components from the layout file? ...
-1
votes
0answers
63 views

Gym application

I currently want to create my first project app, that will help user to start an adventure in a gym. The code that I provided is for set by given earlier value the spinners with body parts. I've got ...
2
votes
1answer
44 views

Helper class for Fragments management

A Helper class for Fragment Management. The FragmentsManager class has methods to add and replace fragments. The replace method checks if the given fragment is present in backstack or not and if the ...
1
vote
0answers
13 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 ...
0
votes
0answers
14 views

Best for storing options in firestore

I am creating a quiz app which consist of different type of question with single option and multi option inintially. So I have to save options. AFAIK I have two ways to save ..For eg. How many fingers ...
1
vote
0answers
43 views

Android app to take a photos and show them in a gallery

Gallery will be displayed in RecyclerView. User can select some images and delete it with one button. It all works, but i think I have bad code, because I don't use some instruments (like fragment). ...
1
vote
0answers
17 views

Encapsulating simple license backup to a disk

I am enapsulating my license backup to disk, using an interface ILicenseProvider and the implementation is DiskLicenseProvider. Also i am throwing an unchecked exception LicenseProviderException which ...
0
votes
2answers
94 views

Displaying 21 spinners to select body parts

I just wanted to ask how can I make my code a bit shorter. As of now, I have way too much code in the class. The program should display about twenty one spinners. I know it's a lot, but in this layout,...
1
vote
1answer
60 views

Android MVVM application architecture

Inspired this guide: https://developer.android.com/jetpack/docs/guide I try to build some app with similar architecture. App interact with remote API via http protocol (json responses from server). ...
2
votes
0answers
44 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 ...
1
vote
1answer
48 views

Using Enum in java to store a fixed set of mutable objects

I already posted this on Stack Overflow, but someone suggested to post it to Code Review instead. I am creating an Android app that draws to the canvas. For this, ...
1
vote
1answer
79 views

Sign Up layout in android

I have created a sign up layout as image below. Does this part of code looked bad since the dp I used for the floating button are quite large. ...
0
votes
1answer
38 views

Simple Registration Form. I would like to get rid of code duplications

I don't like my current code, because of duplications. What's the best way to leverage Kotlin to make it more concise. I have simple registration form ...
1
vote
1answer
47 views

Handler for several kinds of requests to modify a database in an Android app

I'm working on an Android app, and at one point I need to retrieve a request code in a callback method and perform some database operations depending on the request code. It started out ok when there ...
1
vote
1answer
49 views

Optimizing loop - Reducing native calls

I am developing Android-Disassembler. I need to optimize the loop below. It is currectly calling native method for each instructions(about 4 bytes). So this loop will be looped about millions of ...
1
vote
0answers
59 views

LiveData, MVVM and Repository Pattern

Is this a good approach or I've just found a nasty workaround? I'm using MediatorLiveData class because seems useful to update the source of a ...
2
votes
0answers
49 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: ...
1
vote
0answers
26 views

Making a lot of similar looking views in Android layouts

I'm getting started with Android development. Take a look at this Android layout file: ...
1
vote
0answers
19 views

Differ returned web link from app scheme

I have a WebView, which loads the returned from a request url. The thing is, the url might ...
0
votes
1answer
37 views

Kotlin reflection to generate one class from class similar with similar properties

This code is intended to generate a class (domain) from a class with class with similar/identical properties (api). Motivation is to speed development time when using clean architecture. ...
3
votes
1answer
87 views

Developing a method of programming a multi-level menu

I am attempting to create my own speech to text assistant. This involves the user speaking and the assistant responding to the user's input. I do this by looking for keywords that indicate the user ...
1
vote
0answers
105 views

Utility Class for location functionality on Android using Google Play Services FusedLocationProviderClient API

I'm new to Android development and this is my first request for a code review. Constructive criticism is very welcome! I've written a class to wrap interaction with Google's ...
0
votes
0answers
33 views

Android mini game background handler

In the same project as in my previous questions I have released a new beta ("0.1.24b") of the game we call "Moon Buggy". It is now possible to get the background to change when completing a section, ...
3
votes
0answers
215 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. ...
1
vote
0answers
46 views

Consuming APi using Rx in an MVP project

I would like to have some input here if possible, this code should make a request to an API and the call should return the desired object. The client to make the requests was made with Retrofit and ...
1
vote
0answers
58 views

Correct Callback for each item

I have added a correct question callback for different types of questions like: radio, checkbox and descriptive.. QuestionListActivity.class (it shows the list of questions to attempt) ...
-1
votes
1answer
2k views

Password and confirm password validation in Android Studio

I just wrote this password and password confirmation validation code function that checks to see if a password is empty or not, and is it match (password = confirmPassword). I'm not sure this is the ...
2
votes
0answers
178 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? ...
2
votes
1answer
47 views

Collision detection on Android

This is the same game code from my previous question. I split the code into smaller "logical units". The runnable code "Moon Buggy" is available in beta from the google playstore. It was previously ...
0
votes
0answers
38 views

Hello World Android App

I wrote a simple Hello World app for Android that does the following: Accepts a name Allows the user to select a language Opens a new activity that greets the user in the language selected by the ...
1
vote
0answers
19 views

Conditionally perform asynchronous actions with RxJava

This seems to work fine however I'm sure there must be a neater way. The outcome should be: If isHidden == true then call canHideAccount. canHideAccount returns a Single. If isHidden != true then ...
2
votes
2answers
57 views

More object-oriented code for Android mini space game

This is improved code from my previous question. This mini game which we call "Moon Buggy" is available in beta from the google playstore. The action is that you control a vechicle on the moon and ...
1
vote
1answer
49 views

Improved Android mini game

This is improved code from my previous question. This mini game which we call "Moon Buggy" is available in beta from the google playstore. The action is that you control a vechicle on the moon and ...
3
votes
1answer
73 views

Initializing an Android activity by reading a CSV file with image IDs, names, and descriptions

I am using Java to create an Android app. I have the main activity read a CSV file, create objects, and then save them into a singleton class so the rest of the activities in the app can access them ...
3
votes
0answers
111 views

Android Tetris App Design

recently i have finished my first bigger Android project. I made a little Tetris App. Here is a picture of my app in emulator: My Tetris has following functions: 1. fast drop down 2. play ...
1
vote
0answers
74 views

Android - perform an action in background every few minutes

I've written the code to perform some action every 5 minutes, regardless if the application is currently on the foreground or not. I'd like to get a feedback about correctness - have I chosen the ...
0
votes
1answer
86 views

Async Task using RxJava2 in Android

I have tried to create the async task using the RxJAVA2. The code is working fine. WHat enhancement can I do in this code? ...
1
vote
1answer
253 views

Implementation of an OkHttp singleton for Android

I'm new to Android programming. I am going to make lots of HTTP requests: 500, 1k, 2k, 10k. I have tried to create a singleton class for OkHttp. I wrote this: ...
5
votes
1answer
126 views

Android game inspired by Space Invaders and Moon Patrol

I'm creating a mini game for Android inspired by space invaders and Moon Patrol. I have completed the important part except for collision detection. Before I do collision detection I want to clean the ...
2
votes
1answer
103 views

About handling data from an API call through RX and Retrofit

I started using Retrofit and RxJava recently and I love it. I am working on an Android project and I am following MVP Repository pattern as specified in Android Architecture Components. I'm still ...
0
votes
0answers
33 views

Display multiple fragments from the main fragment

I'm working on an app that has a profile page with three buttons: education experience skill When the user clicks any of these buttons, then one fragment should display the relevant information. For ...
2
votes
1answer
518 views

Accessing Adapter data from ViewHolder

In my Android app, I need to disable a button in Layout if the api return status as 0. I get this status in the Adapter and based on it, I have disabled the button in ViewHolder which is inflating the ...
6
votes
2answers
805 views

Multithreaded TCP Client

I implemented a multithreaded TCP client in java for use in an android application. The purpose is to implement the TCPClient interface to allow another thread to post strings to the server and read ...
3
votes
1answer
52 views

SQLiteOpenHelper for multi string tables

I wrote this simple SQLiteOpenHelper in order to use in one database various tables containing String records (each record having a String identifier, and ...
2
votes
1answer
415 views

Android get container width instead of display width

I want to display a text of variable length in a cardView. To make the text fit, I split the text after every 500 Chars and add the substring to another ...
0
votes
1answer
35 views

Unit Testing Android Studio

I am carrying out unit testing for my project but i am not sure i am doing it correctly. The example below calculates the difference between 2 time duration's. ...