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
2
votes
0answers
187 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
64 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
113 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
43 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
48 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
53 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
797 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
65 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 ...
0
votes
1answer
167 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
216 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
277 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
768 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
57 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
79 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
7k 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
409 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
49 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
21 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
65 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
52 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
154 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
545 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
405 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
142 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? ...
2
votes
1answer
733 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
160 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
185 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 ...
3
votes
1answer
2k 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
2k 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
57 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
2k 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
38 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
57 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
77 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
64 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
2k 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
157 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
216 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
139 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
243 views

Simple Android Flashlight app

One of my first projects. I present to you - Android Flashlight app! ...
2
votes
1answer
1k views

Getting location using LiveData and FusedLocationProviderClient

My goal is to get the location when the app starts, and if the user navigates away and comes back, to receive one location update and that's it. I am worried about removing the observer in the ...
1
vote
0answers
53 views

Basic Java Android app for computer data logging in an SQLite database

This is a pretty basic app I made to collect data necessary for a separate project. However it's also my first go at doing any Android programming, so I know there's definitely issues with it (the ...
0
votes
1answer
1k views

WeakReference in AsyncTask

I want to use the WeakReference approach to not leak memory with my AsyncTask. I found examples online and on Stackoverflow, but ...
0
votes
1answer
158 views

Android SQLite database with 3 tables

I want to show you the SQLiteOpenHelper and Contract class for a little quiz app I made for practicing purposes. I have 3 tables ...
1
vote
1answer
91 views

Restoring the instance state of an SQLite quiz app in Android

The following class is the activity of a little SQLite quiz app, which takes care of showing the actual quiz. Other than that the app only has a starting screen. I want to save the instance state and ...
2
votes
1answer
7k views

Android: Make a Quiz-App

Task description Make an quiz-app based upon a topic you feel familiar with! Following requirements Has at least four questions. Following controls are all used at least one time: Button, TextView,...
1
vote
0answers
64 views

Subscribing to multiple sources in RxJava

I have used RxJava to Observe multiple sources and then perform action depending upon values of Observables. I want to know if it can be further simplified. Goal: Complete implementation of RxJava. ...
2
votes
1answer
5k views

AES Encryption/Decryption with key

Is this the best way to encrypt/decrypt data? And Is it good to store Generated InitVector and CipherText in database as Base64 String which is converted from byte[]? ...