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
1
vote
0answers
311 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
25 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? ...
3
votes
1answer
479 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 ...
2
votes
0answers
579 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 ...
1
vote
0answers
56 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
19 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 ...
3
votes
2answers
152 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
2answers
577 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
285 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
109 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
137 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
45 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
49 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
57 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
2k 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
78 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
27 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 ...
1
vote
1answer
248 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
316 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
440 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 ...
5
votes
0answers
1k 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
61 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
83 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) ...
0
votes
1answer
13k 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
667 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
52 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 ...
1
vote
0answers
22 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
68 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
55 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 ...
4
votes
1answer
193 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 ...
8
votes
2answers
2k 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: fast drop down play tetris music ...
1
vote
0answers
641 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
168 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? ...
3
votes
1answer
1k 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
176 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
297 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 ...
4
votes
1answer
4k 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
3k 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
58 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
4k 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
40 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. ...
1
vote
0answers
73 views

Pushing a value to a Processor on a separate thread

I am attempting to use Room along with a full-text search (FTS) table. The issue is that Room doesn't recognize or support FTS tables. Though there is a work around for this; you just create the FTS ...
3
votes
3answers
80 views

Sort Array into different arrays based on the number of objects appearing in that array

Assume filteredEvents from below to be a List<Filter>. Basically a list of objects, each of these holding a list of days ...
5
votes
1answer
67 views

Mini space game for Android

I have created a mini Android game. The aim is to catch aliens in space. You score points for each aliens, there is a pause function and you can change the level of difficulty and change spaceships. ...
0
votes
1answer
3k views

Kotlin text validation

I'm new to Kotlin, not so new to Java and Android development. But willing and trying to ...
2
votes
1answer
292 views

SQLite Quiz with Questions Table and Categories Table

Edit: I changed my approach. I am trying to add categories to my existing SQLite quiz. This is my approach, what do you think about it? Do you think the foreign key restriction is necessary? I am a ...
2
votes
0answers
277 views

Show mobile SoundCloud player in WebView

Demo for a SoundCloud player in WebView for specific song or artist stream as a workaround because SoundCloud is not accepting API key request anymore. SoundCloudWebView: ...
2
votes
0answers
164 views

Simple arcade game where you just move the character around

What My Code Does I made this simple arcade game where you use the mouse/pointer to move the character around, by now it's all it does, it uses phaser.io My Concerns I'm new to Phaser (and a crappy ...
0
votes
1answer
322 views

Simple Android Flashlight app

One of my first projects. I present to you - Android Flashlight app! ...

1 2
3
4 5
16