All Questions
32 questions
0
votes
1
answer
158
views
Best way to run a function 10 times, at 10 second intervals
Basically I have a function that loads questions for a trivia game. Each game has 10 rounds. Currently I have it in a four loop and tried using CountDownTimer but it would still iterate through and ...
-3
votes
1
answer
85
views
Why value of only last iteration(999) is printed in the text field ? I want all numbers to be printed before getting replaced by next number
I am new to android studio and want to overcome from this problem.
It gonna help me a lot while creating some future apps like , stopwatch, timer etc etc.
Thanks in advance !!
public class ...
0
votes
1
answer
80
views
How to iterate Node.js database query results in Java/ Android
I query a table in a database and got the following results :
{"command":"SELECT","rowCount":4,"oid":null,"rows":[{"id":1,"title":"Cheese","primary_author":"9.99"},{"id":2,"title":"Cheese","...
0
votes
1
answer
176
views
Replace colors in an image without having to iterate through all pixels
Let's say that I have an image like this one (in reality, I have a lot of them, but let's keep it simple)
example picture and I'd like to replace background color (that's the one that's not roads) ...
0
votes
1
answer
42
views
Better way to add and remove Objects in game than ArrayCopy
I’m working on a 2D game and using SurfaceView/Canvas to display my Bitmaps on screen. The Bitmaps are constantly added and removed from the canvas. At the moment I store all the Bitmaps that have to ...
3
votes
2
answers
258
views
best practices for accessing a for loop variable inside an inner class
While making an android app I encountered and issue regarding accessing a non final variable from an inner class. used This as a reference.
I wanted to ask what is the "proper" and efficient way to ...
0
votes
2
answers
55
views
How to iterate over JSONObject and found id by value which already known, for example I want to get id of value "ТС-41" how can I do it?
{
"0":"",
"54049":"ОП.мз-61а",
"100606":"КМ-41",
"100609":"МТ-41",
"100612":"ЕМ-41",
"100684":"ХК-51",
"100685":"ЕМ-51",
"100687":"КМ-51",
"100688":"МТ-51",
"100718":"ХК-51/1",
"100719":"ХК-51/2",
"...
1
vote
0
answers
28
views
Iteratively generating animations - android
I am trying to make a TapTapRevenge-esque game and I'm having trouble generating the note animations. I have a note class:
class Note {
int hitTime;
int y;
int pos;
int iniX;
...
0
votes
1
answer
54
views
Temporary Sprite in Android App
I have an android game where there are sprites moving about the screen. When one is hit, it adds or takes away from the score and then disappears.
What I would like it to do is create a blood ...
0
votes
0
answers
39
views
Nullpointerexception on layout.getChildCount() Android Java [duplicate]
Heyho, I'm pretty new to java programming for android and i hope you can help me.
Here is the method that's giving me nightmares:
public boolean CheckInput(View v) {
if (v.getId() != R.id....
1
vote
1
answer
56
views
Iteration run faster for "even teams" code
I am coding to create two "even teams" based on the players' scores (puntajes).
The algorithm runs through the array of players and compares the score of each one to get a minimum difference and ...
0
votes
0
answers
332
views
get element from array list to make a soap request and get information
I want to use the element from an ArrayList to get information of all of them and put them in a listView. But when i make the iteration with a for, my app blocks. Can someone tell me how to do it and ...
0
votes
0
answers
27
views
Getting Concurrent Modification Exception while update entry of ArrayList [duplicate]
I'm going to manage received message from server in my android client. For this goal I'm using ArrayList(HashMap<String, Integer>) to store arrived messages.
private ArrayList<HashMap<...
0
votes
1
answer
78
views
Android MongoDB Document iteration not consistent, confused
I'm trying to iterate through all my documents and parse the values and add them to their own lists. The thing is when I try to parse and add to the list it stops early half way through to be exact. ...
0
votes
1
answer
216
views
Java - adding existing objects to view iterating through an array list
what I want to do is press a button to add previously declared TableRow objects (refers to TableRow objects already created in XML file) that I have hidden using table.removeView(row1) etc on program ...