Android is Google's software stack for mobile devices. For non-developer questions, see http://android.stackexchange.com
1
vote
0answers
7 views
notifyDataSetChanged after list update within Fragment [on hold]
I'm brand new at Java and have read a bunch of questions/answers about this but have not been able to find a solution which works.
I have a ListView and when I remove an item from my list (within ...
-3
votes
0answers
13 views
Error when i start my application bluetooth [on hold]
(i´m level basic). When i start my application it shows a message "the main application screen stopped",before not passed.... I am working on android studio, using bluetooth...
...
4
votes
1answer
70 views
-1
votes
0answers
11 views
Android Pass Data between fragments [migrated]
I have a question about passing data using bundle between fragments. I need to pass the URL from a Product object to the next fragment, so I don't know which is the best approach: to pass only the URL ...
2
votes
3answers
53 views
Static method to create intents
I had the idea to have a static method on an activity which creates intents that it can use. For example if I have an activity with a webview that can load html from a resource or a URL I would have 2 ...
3
votes
0answers
49 views
Event Aggregator Pattern Decoupling
I have an Android application that is using an EventBus architecture with publishing and subscribing events. Usually this is ...
2
votes
1answer
46 views
Handling screen rotation with volley request
To handle screen rotation when performing a volley request, I've written this code:
...
7
votes
3answers
85 views
Fastest way to change the HSV value of all pixels in a bitmap
I want to change all the pixels in an image to have the same value, in terms of the HSV colour space.
At the moment I'm running the following code:
...
1
vote
1answer
45 views
Is a Timer the best way to achieve recursive in Android?
I'm changing the Viewpager items programmatically using mViewPager.setCurrentItem(position); with a regular interval of time recursively. Please tell me if this is ...
2
votes
1answer
20 views
Java port of Titlecase
I have a port of titlecase, originally in Perl and ported to other languages such as JavaScript and Python.
...
0
votes
1answer
51 views
Inserting data into an SQLite database
I've execute this code in Android for inserting 100+ rows in SQLite database.
My current approach takes more time to initialize the database.
...
1
vote
1answer
44 views
1
vote
0answers
65 views
Track user's location and broadcast over Pusher
I am trying to track the user's location and transmit it periodically via Pusher (real time data service, pusher.com).
I am using Google Play Services for location handling. I need the location ...
1
vote
1answer
42 views
Safely using android 'Context' inside threads
Oftentimes I find myself using context inside threads, multiple times. The problem is that I do not want to hold a long-lived strong reference of it in my threads to avoid leaking it. I keep a ...
0
votes
0answers
24 views
Android Zoomable Listview
I spent a day looking for a Zoomable ListView and every answer was broken in some way. Finally I found a great template and made a couple changes to handle scroll boundaries.
You can extend any view ...
2
votes
1answer
60 views
OpenGL ES 2.0 Sprite rendering
Is this a good method to render sprites (textured quads) or is there a faster or better way?
Example use:
...
1
vote
2answers
39 views
Alert dialog manger class
I want to make a general alert dialog to use across the whole app. I created a class called AlertDialogManager and just one method to show ...
4
votes
1answer
40 views
4
votes
0answers
43 views
Android Google Play Services code for GPS
I'm using Google Play Services for Location in my Android app. This is my first app so I'm not expecting that I have utilized everything perfectly.
My app is to get GPS/Date and send to a server ...
4
votes
1answer
96 views
Accelerometer for Lightsabers - slicing through the Dialog interfaces
I am doing a lightsaber app for fun. I followed a tutorial to learn how to get information from the accelerometer to play lightsaber sounds. It instructed me to have the Activity where I get the ...
8
votes
2answers
80 views
Camera intents and file manipulation
I am building an Android application and there are five Activity classes or if you're familiar with the MVC pattern they would usually be the ...
4
votes
2answers
61 views
Program to provide CRUD operations for a Boxers(Fighter) table in a database
I have been through a few SQLite tutorials and wrote this code on my own to reinforce the principles. The tutorials I went through varied widely in a few areas so this is what I came up with as a ...
1
vote
1answer
56 views
Lookup map for converting Strings into Android `R.raw` integers
I'm currently working on an Android app and I need to translate keys of type String to Integers which are determined at compile ...
2
votes
1answer
48 views
Play market in-app billing
I want to add in-app purchases to my application. In-app in test mode works great, but there is no check on their authenticity. While googling some info about making server-side of in-app, I found out ...
2
votes
1answer
55 views
Replace an element of a List with a concrete Id
I want to replace an object of a List with another one. To find the item to replace I need to check the field id of the object ...
0
votes
1answer
195 views
Custom ListAdapter with ViewHolder Pattern
I wrote this class for a custom list adapter for my list view. I use the view holder pattern to make the list view move smoother.
Could anyone advice tell me if I did something wrong, or some way to ...
2
votes
2answers
72 views
Parsing a text file of node data into Nodes and Edges
I'm a fairly new developer (well, engineer really, but currently working on a software project). In the Android project I'm working on, I read a node representation of a map into my app and interpret ...
2
votes
1answer
179 views
Checking for Internet connectivity on Android
I wrote this code to check an internet connection and was wondering if this is the best way to do this check.
...
1
vote
2answers
81 views
AsyncTask alternative with Runnable and CountdownLatch
What is wrong with this pattern which emulates AsyncTask functionality?:
...
3
votes
2answers
172 views
Memory efficient A* (AStar) Algorithm
I am writing a solved for 15 puzzle game which will find the solution path to any NxN board. For easier boards the algorithm works great solving almost any 3x3 boards, most 4x4 boards, but when I go ...
1
vote
1answer
225 views
Xamarin image download and resizing for Android
This code addresses performance issues specific to Android running Xamarin / C# when downloading images (BMP/PNG) into a listview. The caller simply specifies the URL to fetch the image from, and the ...
4
votes
0answers
98 views
Dots game in Android
I'm trying to clone a Dots game with some little differences (power ups and objectives) as a school project. I have almost every objective done so no, I'm not trying to get my work done for free. I am ...
5
votes
2answers
68 views
Open Source Tokenizer
I'm developing an open source annotation processor for Android (ngAndroid). Part of the library is a small Java subset compiled language that can be used for data binding, events, etc. I plan to ...
1
vote
0answers
26 views
Adding rows to LinearLayouts which serve as lists
I have a fragment with a ScrollView and, inside of it, I need maybe 5 or 6 lists. To make things simpler, let's say there are three lists - list of names, list of ...
2
votes
1answer
89 views
Message queue with multiple producer, single consumer and no duplicates
I had to make a message queue in an android app which my thread takes messages from and processes them. There can be multiple producers and duplicate messages should be avoided. Rate of insertion is ...
3
votes
1answer
40 views
Data formatting using string spanning
I would like to know how to make my code better. I'm still a newbie in Android, so any tips are appreciated.
The code is an AsyncTask class extender that formats data into a nice looking Spannable ...
2
votes
0answers
119 views
Using an Adapter with Parse query in Android
I'm an iOS developer new to Android. I'm creating my first Android app and I have several questions. My app uses Android Studio, gradle, and it's based on Parse (the backend). Basically, takes ...
2
votes
2answers
331 views
Validating multiple EditText fields
I am using the following method to validate if user has given any input or left an EditText empty. I am concerned about the ...
3
votes
1answer
167 views
Android Custom WebView
I have made a custom webview which is used to open a very heavy site in terms of database. The webview uses custom code for uploading files using an upload handler class. I need suggestions on how I ...
0
votes
0answers
22 views
Foundation for MVP in Android
I have been experimenting with the MVP pattern in Android, especially inspired by Advocating Against Android Fragments. I'm trying to build a library out of it, where the concept of ...
1
vote
1answer
44 views
Three buttons with click listeners that pop up a quick toast
I currently have three buttons, perhaps more to come. When I click on a button, I want a toast notification or message (popup message) to show up with some text. What I have works perfectly but it is ...
4
votes
1answer
71 views
Reading a text file API 15+
Is there a faster, more efficient way to read a text file than this implementation?
Taking into account phones capabilities:
...
2
votes
0answers
45 views
Structured use of Android SQLite transactions
I got tired of following Android-SQLite's transaction idiom, briefly documented here.
It requires too much boilerplate code, IMHO, especially when you add the obligatory null checks. So I came up ...
1
vote
1answer
115 views
Parsing a file for an Android device
I am trying to parse InputEvents of an Android device.
Background:
For an android device we have a utility getevent ...
4
votes
1answer
71 views
Porting a web-based POS system to Android
I'm currently porting a web-based POS system to Android. The Android version uses NavigationDrawer to navigate between menus.
What I need a code review on is my ...
13
votes
2answers
355 views
Localizing an enum in Java
I am currently using an enum in my Android application to display time periods:
Weekly
Bi-Weekly
Monthly
Quarterly
Yearly
I created the enum like this, because I wanted to know the description, ...
2
votes
0answers
50 views
Parallelized image transformations using GraphicsMagick
This is part of a script that I use for porting a TWRP Theme from one resolution to another. Respectively portrait to portrait and landscape to landscape. In this function entirely, it focuses on the ...
2
votes
1answer
97 views
Android - Simple multi-activity app
This is a task from lab classes at my university. Problem statement was to showcase following features:
Multiple activities in app.
Passing data from one activity to another.
Changing behavior of ...
4
votes
2answers
251 views
Extracting a sentence containing a specific word from a longer text
My goal is to return a specific sentence in a story that contains a given word. Returns null if the word is not in the story. I'm ok with returning the first ...
4
votes
0answers
78 views
Is this test sane? I may have re-invented the wheel on how to test that a method does not block
I have an Android service which must offload a task to a different thread but schedule the response callback unto the calling thread. After much thinking I came up with this code:
...