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

learn more… | top users | synonyms

3
votes
1answer
50 views

TaggedLogger - Log wrapper

I wrote this class in order to not having to write tag every time (because of code duplication and risk of typos). ...
-5
votes
0answers
20 views

OutOfMemory error even though Large bitmaps are handled efficiently [on hold]

I'm developing a tour guide application. I'm using a flipper view for images. I have decoded bitmaps. But it still gives the outofmemoryError. Please help me with this. Thanks in advance 09-01 ...
4
votes
1answer
36 views

Persistent cookie support using Volley and HttpUrlConnection

I need to add support for persistent cookies on an Android app that I'm building for Authentication/Authorization. This app uses Volley for making HTTP requests and it's ...
6
votes
1answer
50 views

Handling large images efficiently (to avoid OutOfMemoryError)

After lots of attempts thanks to all the Android enthusiasts, I've found a method to handle large images efficiently in Android Applications in order to get rid of ...
4
votes
2answers
113 views

ToastUtils - helper class for Android SDK Toast

Using: ToastUtils.LONG.show(context, R.string.greeting); Code: ...
7
votes
1answer
60 views

Android “Search” Activity and corresponding XML

Below is an Android Activity and corresponding XML layout. The function of the class is to search an ...
3
votes
1answer
56 views

Structural design of a Date and Time classes [closed]

I have two classes named Date.class and an enum class Time. I have declared these class like ...
6
votes
2answers
51 views

Android audio player

I want to implement basic audio functions like play, stop and pause. I have stuffed all the code inside onCreate method. Is this best practise to follow? ...
7
votes
2answers
126 views

Using Java to Add the Contents of two EditText views in Android

I have a toy app that contains: editText1 for entering a number. Uses inputType of number. ...
3
votes
1answer
42 views

Creating a fast Android dictionary (word counts)

This is a follow-up of my question here: I am currently working on an application for various statistics. One task is to analyse a good amount of sentences for their word counts. The specifications ...
5
votes
1answer
117 views

Using temporary variables or calling a method directly

Which of these approaches for a button click is better/faster/more efficient, and why? Approach One: ...
3
votes
2answers
84 views

onSaveInstanceState() - ensuring a call to super instance

When onSaveInstanceState() is customized it should always call the same method on the super instance first. I usually write: ...
4
votes
2answers
51 views

Fetch details from server

I am using this code to fetch some details from server from my android app. How can I improve it? Here I am also transferring some data from one activity to another. This is how I have written my ...
6
votes
2answers
51 views
10
votes
4answers
493 views

Integer seconds to formated string mm:ss

I have a String like "Time left (XX)" or "You need stay here for (XX)" and int as second. I use those two variables to format ...
5
votes
2answers
176 views

Calculating months elapsed since a given date

I am using traceview and DDMS to analyse my operation. The following is my traceview as displayed in DDMS: According to the above, the LoaderClass.months() ...
0
votes
1answer
51 views

256 bit AES encryption in Android

I am using the following code to encrypt a file in an SD card in Android: I want the code to be reviewed for: Security (prioritize this) Coding Style Performance ...
2
votes
1answer
38 views

Android loading playlists function

...
3
votes
2answers
88 views

Is this too much work for 1 listener?

Is this too much work for 1 touch listener? Is this bad for devices with slow CPU's? ...
2
votes
1answer
69 views

Refactoring Android fragments

I have an Android app that shows some fragments, but I'm repeating lots of code. MainActivity.java ...
2
votes
1answer
62 views

Loader animation using Custom View in Android

I created a loader animation for an Android app: a simple 3 dots loader. Is this the correct way to animate by using TimerTask? ...
7
votes
1answer
95 views

Perfect game loop

I've been working on development for an Android game, and this is the game loop I have so far: ...
10
votes
1answer
150 views

Why does the new ADT create a static inner class Fragment by default?

Honestly, I can't help but feel that this is done merely to confuse newcomers. Most of the errors on Stack Overflow by complete Android newbies mostly stem from that they have a static inner class ...
1
vote
1answer
92 views

Null checking in nested getter calls [closed]

I have the following piece of code and I would like to see what different approaches would be to solve that in a more elegant way. The thing is that I don't know whether is better to have the null ...
3
votes
2answers
182 views

Locate user of an Android device

I am new to oriented object paradigm and I work on Android using Java project for an internship. I must be able to locate the user and some around buildings I read stuff about how to setup ...
5
votes
3answers
746 views

Class for catching error and logging

I often write something like this in my code: ...
5
votes
1answer
44 views

Using SQL to reorder items in a list view - is this efficient?

I'm writing an application for work that requires me to process a list of transactions. The list is small (5 records at the most) and I'm required to display that data in an android ...
4
votes
2answers
162 views

Custom grid view with different columns

I am developing a custom grid view with different columns. EDIT: Here View Possibilities Mockup Here is the full demo. You can directly use it, with Internet uses permission. This works ...
10
votes
2answers
386 views

Create albums out of songs

I have made a method which returns a list of all songs on my device. Now I want to get a list of albums out of these songs. What I basically do is go through every song I have in my list, check if ...
3
votes
3answers
266 views

Run different methods in background threads without duplication

In my Android app I have number of methods that should be executed in a background thread. One of the methods looks like this ...
6
votes
1answer
60 views

Searching for songs on an Android application

In my application I need to search for some songs on my external storage card every now and then. On startup I read everything, however when it comes to new activities I thought I could just pass the ...
4
votes
2answers
60 views

Android global data

I have a huge list of song objects in my program and I need those objects in almost all activities. Well, at least a part of it up to everything. So I created a class which looks pretty much like ...
0
votes
1answer
33 views

Touched events created in a for loop [closed]

All I want is a simple "yes/possible" or "no/and that's bad coding". I have a card game I'm making and looking through your discard pile is a big part of it, so it's going to be constantly growing. ...
7
votes
1answer
53 views

BananaQuery - Android one-line query

I created this library just for fun. Since I was a bit tired to write 10 lines of code to execute a simple select query in Android, I created a way make it simple. It's not so advanced and some ...
6
votes
2answers
74 views

Passing listener to customized extended View in Android

I extended NumberPicker with several methods needed in my application. When I came to defining a OnValueChangeListener this is ...
3
votes
1answer
51 views

A generic MVC ArrayAdapter class

Like everyone, I use ListViews in a lot of apps. And I pretty much always end up making a custom Adapter. Yet 90% of my custom adapters end up doing the same ...
5
votes
1answer
76 views

Sprite is Refreshing

I am using "AndEngine" and I would like to know if I am following the best practice when I want to refresh the entity. Let say, I have 2 sprites and I want change them into 2 another sprites. I ...
10
votes
3answers
81 views

Optimization of aStar in Java

I'm currently looking to optimize my aStar algorithm as my last run through took roughly a minute to generate one path. I've never had to optimize before as I've never run into performance issues, so ...
2
votes
2answers
303 views

Efficient and fast way to send data from Android to server

I have an app that will be sending images ranging from few KB to ~20MB and I need to write a code that will do that in the fastest and most efficient way. I currently have a code that does this, but I ...
7
votes
1answer
165 views

Unit conversion activities

Please review these activities which handle converting units in an Android app: I would appreciate any guidance and advice on code refactoring and different design patterns or strategies that I ...
2
votes
1answer
68 views

ListView with a search filter

I have this piece of code I've been working on for quite some time. It's a ListView with a search filter. Inside each row, it contains a user Image, a User's name and how many friends they have in ...
0
votes
0answers
54 views

Improving equal spacing between elements in layout

I am trying to make a nice set of items, which are equally spaced from each other. On example below, I set buttons between empty textview. Every button and text view has height = 0dip and weight=1. ...
2
votes
2answers
377 views

Generic HTTP using Android Asynctask

I have developed a generic HTTP functionality using Android Asynctask and Apache HTTP client. Please review the code and let me know if it is the right way of doing or there are other ways to achieve ...
1
vote
1answer
40 views

Reducing imageview buttons code

This code is very long, and you need a separate method. How can I implement it? I have 6 (x2) imageview buttons and 6 edittext. ...
6
votes
1answer
67 views

Delete (Reverse Backspace) Button

I have built a delete button in Android, just like in Windows, which removes the string on the right hand side of the cursor (one by one). (Instead of the mainstream Backspace which removes the left ...
6
votes
2answers
114 views

Create and organize some classes (hierarchy)

I'm trying to figure out what is the best way to create some objects in my application. The application is already running, but I want to structure things well and clean. These objects represents ...
4
votes
2answers
67 views

Callback on AlertDialog

I am using an AlertDialog in Android, asking the user for some input. I would like do run some code when the user has finished entering her input. Since an ...
2
votes
2answers
105 views

Populating a ListView via a php script in Android app using AsyncTask

This class retrieves JSON data from a PHP script and uses the data to populate a ListView using AsyncTasks. Any ideas on how to improve it? ...
0
votes
1answer
95 views

Retaining and passing data between Activities [closed]

I'm making an Android app where users can create posts. This process of creating a new post can potentially be a few activities/screens, so I need a way to save and pass the data between the ...