Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com
0
votes
0answers
14 views
Android Canvas - Draw a line graph with a gradient whose color depends on the y value
I'm looking mostly for feedback on a solution of mine. I want to create a pretty line graph where the color of the line is dependent on the Y value, and a change in color at ...
2
votes
1answer
35 views
Tic Tac Toe in Android
I made my first Tic Tac Toe game on Android and I'm looking for a way to simplify, make the code more flexible and remove the hardcoded code. I managed to do this game by looking at different ...
5
votes
1answer
65 views
Parse and format date
I have the following code for taking a date in the form of a string yyyy-MM-dd HH:mm:ss (UTC timezone) and turning it into ...
0
votes
0answers
34 views
Designing transport service app in Android
I am new to this SE and so bear with me. Sorry for the long post. But this much info is needed to explain !
Background:
I am student and working in one science institute. Our university has bunch of ...
0
votes
1answer
42 views
ListView + ArrayAdapter: Setting OnClickListener to items
I've recently written a Java program that displays a list of Word objects using a ListView and a custom ArrayAdapter.
I also want to set an OnClickListener on the items that plays an audio file (...
1
vote
0answers
39 views
Make methods shorter when parsing Firebase data
I have a simple parsing method from firebase. How i can do it smaller?The fact is that after the data is changed I will need to update my View so that the code can be added, which also does not sound ...
5
votes
2answers
120 views
Text messaging app that allows you to interact with AI
I'm developing an android app that is basically a text messaging app that allows you to interact with AI.
What should I do about staying organized while starting my first large project? I fear that ...
1
vote
0answers
48 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,...
2
votes
1answer
57 views
Get and use user's current location efficiently for Route Calculation
I am trying to get the users current location and then the render the route using here-maps sdk with the location of the car provided from the Intent, I have a feeling I can improve it a lot as I have ...
0
votes
1answer
66 views
Quiz project with XML and Java
I'm learning to code Android apps and have recently finished a quiz app.
I would like some feedback about best practices and possible ways to improve performance, as I'm also new to Java.
This is my ...
1
vote
0answers
19 views
WiFi controlled car code for android - improvements?
This is my android code for wifi controlled car (that use to be a RC car) I have couple of ideas on improving it, but I am not sure if I can explain it properly, but I will try. Should I add a ...
1
vote
2answers
96 views
Code for writing and reading from the database
I created code for inserting and retrieving data from a specific table. I tried to optimize it and make it as beautiful and easy to read as I can, but maybe (almost certainly) I'm missing something.
...
2
votes
1answer
64 views
Using serializable to preserve/save objects
I'm building one of my first android apps. I met this problem that everytime you change screen orientation, Android destroys the app and builds it up again (I know this is more complex, but this isn't ...
3
votes
0answers
54 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 ...
0
votes
0answers
61 views
Show common contacts of contact list and Firebase database using Android
I want to show those contacts who saved in Firebase database and in my Android contact list:
...
0
votes
1answer
59 views
AsyncTask for subscribing to current location
I made the below CurrentLocationTask as a way of reducing code duplication, as my application currently has 2 different Activity...
0
votes
0answers
52 views
HttpURLConnection implementation with AsyncTask
I am using HttpURLConnection with AsyncTask.
Is this a good approach for network requests or does it need some modifications?
...
2
votes
0answers
21 views
Extend OnClickListener and animate view in android
I'm working on animation and I want to organize my code in best way I'm new in android and not know too much about this. Here is my code that I'm using to animate ...
1
vote
2answers
64 views
Passing “This”, but not really [closed]
So i am developing an Android application as a side project/hobby and I have come across the situation that I have to pass an Activity into a method for use a context (Don't question it)
The problem ...
1
vote
0answers
25 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 :
...
2
votes
1answer
54 views
Code for filtering in ArrayAdapter
I have created a code for filtering a list of strings and redisplaying this list. I check if string is starting with a certain letter.
It seems to work, but I wonder if I did all right? Havent I ...
3
votes
0answers
28 views
Proper way of Loading Image/Texture Sprites on GameScreen in LibGDX?
Good day everyone 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 start learning LibGdx. I already coded my ...
-1
votes
1answer
56 views
Receipt printing tabulation [closed]
Currently I am working on a Receipt Printing Tabulation code in Java/Android.
...
4
votes
2answers
454 views
1
vote
2answers
92 views
Make use of Object Oriented Design in an Android App with multiple activities
First off, I'm no Java programmer(but I do know the concepts of OO programming), I have this project I need to work on but I currently don't have a lot of time to spend in learning Java and then ...
0
votes
1answer
81 views
Finding prime numbers performance
I am writing an app that finds prime numbers within a specified range. Currently i am updating almost every part of the app and i have also changed the way i find prime numbers. The problem is that ...
-1
votes
1answer
45 views
Android/Java REST class not so DRY (yet)
I understand and apply the DRY principle but I have a hard time getting this DRYer than it is right now.
...
5
votes
0answers
45 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.
...
2
votes
0answers
49 views
Android app to let users complete tasks for cash
I am doing an android side project, and I was wondering if I could have my code reviewed to get feedback on improving its efficiency and overall elegance. Particular classes to focus on would be ...
1
vote
0answers
55 views
Filtering listview results when spinner values get selected
I have 3 spinners in my project named standard, division and age. They contain values from json data. When I select a value from each individual spinner it shows all data of students in a listview who ...
3
votes
1answer
73 views
Android App Simple calendar/scheduler
Wanted to make a schedule for myself that was (hopefully) light-weight. Right now it just has the bare essential function of saving text for a certain day.
Looking for advice on literally anything ...
1
vote
0answers
16 views
Android app that makes certain actions in response to the state of toggles
I've written an Android app using Android Studio that, when the main switch is enabled, toggling other switches or pressing a radio button calls a certain script.
I'm familiar with Java itself, but I'...
4
votes
0answers
26 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 ...
1
vote
0answers
85 views
Sync SQLite databases using threads and a Service
I have an Android app that collects data in n number of SQLite databases. The user decides the value of n in runtime. A Service is in charge of sending that data to our server. We used to do this with ...
1
vote
0answers
47 views
Collecting a user's Stripe information
I am new to both asynchronous programming and Android development. I am allowing the user to sign in with either their email/password or their Google account. Upon successfully signing in, the user's ...
5
votes
1answer
109 views
Interface design to have multiple implementations of network call libraries (Retrofit or Volley)
I am learning design patterns from Head First Design Patterns and a principle I came across is to "code to interface". Now I want to apply this principle in my Android app, which includes lots of API ...
8
votes
2answers
97 views
Updating positions of enemies every frame
I am making a game for Android using Java and libGdx. I have an ArrayList of enemies that are updated each frame. The update method for the enemy looks like this:
<...
2
votes
0answers
32 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 ...
1
vote
0answers
33 views
Highlight selected item in GridView
This code displays images in a GridView. It allows the user to select an item at which point a custom checkbox is checked and the area around the image is highlighted a different color. (The image ...
0
votes
1answer
51 views
Random Number Generator from user touch input
I have this in place for an RSA Key generation class. I force the user to swipe on the screen randomly and use that as a entropy pool.
...
2
votes
1answer
81 views
Loading interstitial adMob in different threads
I want to load Interstitial AdMob after 5 second, after the Activity started, in another Thread. Is this code right, or I'm duplicating ...
1
vote
2answers
137 views
3
votes
1answer
53 views
Adapter class displaying characters' info
I have finished creating an adapter class which displays characters' info.
When I looked back and reviewed my own code, I think the code fragment below somehow could be broken into smaller methods.
<...
0
votes
2answers
103 views
FutureTask in Android, wait for a thread to execute the next one
This code is executed on a background service every 60 seconds on an Android app. Each class instantiated on FutureTask (WifiInfoFetch and WifiApResults) contains an insert to an SQLite database. We ...
0
votes
0answers
17 views
Fetching meta-data from the AndroidManifest.xml in a fragment
I'm creating a YouTubePlayerFragment inside of a fragment. When initialising the player I need to pass an API key to it. So I end up with something like this:
<...
4
votes
0answers
80 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
1answer
98 views
Creating new async tasks
In the past, I have used AsyncTasks to perform network requests for my Android app. I recently switched to RxJava to be able to cancel the requests when the user exits an activity. I have created a ...
2
votes
1answer
74 views
Animation with orientation change of Android device
I've started my first "job" like 2 weeks ago, and to be honest I've received a quite hard task to do, since I'm beginner with Android, and quite fresh at programming. The thing I needed was to find ...
3
votes
1answer
142 views
ButterKnife.bind with super class
I am using ButterKnife in my project, and as we know we have to write ButterKnife.bind(this); in all the activities, so I have ...
-1
votes
1answer
68 views