Android :: AutoCompleteTextView Static Data / Slow Performance
Jun 1, 2010
I am facing the following problem: I have a big list of street names(~2000 entries), which is stored as a variable. I have an AutoCompleteTextView which should complete the names. The process takes really long time(approx. 2 - 3 seconds) to complete the suggestion. Is there any way to speed this up? I am pasting my code, if this is necessary:The getStreetsData() method simply returns the static list of the names.
View 2 Replies
Nov 24, 2009
I am writing a program where I have to access some static data, and now I am looking for the best method of how to include them into the project.Reading in the data by parsing an XML is *slow* (even using the SAX parser). 2. Reading the data by parsing a CSV file is faster than loading an XML, but again is too slow. 3. Putting the data into a Java file directly (e.g. by defining an array) fails because Dalvik says it is too large. 4. Reading in the data using serialization is slow. The funny thing here is: It takes a bit longer than loading the XML file. 5. Reading in the data from a SQLite database is the fastest method until now. But a bad workaround is needed: A SQLite DB can not yet be read directly from the resources, but instead has to be copied to the cache or to the SD card - even for read-only access. Right now I am using method 5, but I would really like to use a more simplified and faster solution.
What I found out: Unserialization in Java is *fast* (reading a HashMap with 5000 integers and strings in 79ms on my PC), while the same action on my G1 takes over 13500ms. I know that I can not compare a PC to a mobile device. But still, there seems to be a big difference here. I think that the JRE directly copies the serialized data to RAM, while Dalvik seems to read every object step by step. Is this going to change in the future? And, most interestingly: what do you do to access lots of static information?
View 12 Replies
View Related
Mar 18, 2013
I have Eclipse Juno and I'm working on an app with that.
The main activity will have a scrollable menu that takes you to all the other activities.
So the general structure/outline right now:[HIGH]Relative Layout ImageView (header logo type thing) ListView (the actual scrollable menu)[/HIGH]Here's the problem though... I can't find any simple list tutorials. I can easily make a single line list work but I need to make a two line list and one that is static, not dynamic and no examples are out there for that. It's like if you want to make a 2 line list, you can only learn how to do it in the most code-heavy ridiculous way possible.
Essentially what I am looking for with the list is this: Item one: Centred, bold, non selectable title (Resources)
- Item two-??: two line list items, click-able to a new activity, title of the section on first line, description on the second line.
- Item ??: Centred, bold, non selectable title (Tools)
- Item ??-??: two line list items, click-able to a new activity, title of the section on first line, description on the second line.
Nothing dynamic that is ever going to change, no super complex wonkey calculations, just to simply have the data set in stone (preferably via XML) and to call it into the list.
I experimented with some of the other list views and no matter what I did, I could get, via editing the resources and NOT using Java, more that one item on a single line but it wouldn't format it properly according to the layout I guess because I haven't got the ID correct or whatever I don't know.
I mean, all the examples I've seen for a 2 line list are extraordinarily over-coded and just bloated. I mean I have a website I am still working on in C#/ASP.net that has far more complex things in it with half the code that I've seen for the examples of the two line lists.
I tried on my own to figure it out (I am decent with C# and vaguely familiar with Java, self taught, and programming for some other systems like Python, again all self-taught), but like ALL coding references, they're organised by the actual code you implement (that you don't know) instead of by what you want it to do (so you have to search the whole code base to find something that you don't know what it's called but know what it does). >:C
View 10 Replies
View Related
Feb 27, 2009
In an app with a small number of POJOs and lots of helper methods that operate on them, what's better performance-wise: to make the helper classes singletons or to make the methods static?
View 4 Replies
View Related
Feb 22, 2010
I just installed the latest version of Eclipse IDE for Java Developers together with the ADT plugin on my Mac (2.8 GHz, 4 GB Ram).
- Opening new files from the package explorer.
For example, opening a layout xml file takes 1-2sec- And the mouse pointer changes.
- Switching between tabs
- Resizing views in the workspace
The performance rapidly decreases when I open more files. Are all of you developing under these circumstances? How can I speed up eclipse?
View 4 Replies
View Related
Oct 20, 2010
my app downloads a zip with about 350 files. A mix of JPG and HTML files. The function i wrote to do it works just fine but the unzipping takes for ever. At first i thought the reason might be that writing to the sd-card is slow. but when i unzip the same zip with an other app on my phone it works much faster. is there anything that i could do to optimize it?
here is the code:.................
View 1 Replies
View Related
Sep 29, 2010
A while back I mentioned that running the imported p2p codebase I have on the emulator (on a fairly powerful laptop with plenty of mem and a fast processor) was pretty slow. I blamed all that on the codebase and in fact I was able to profile it and make it much lighter. Well still the overall app performance is slow --- and I am finding that most apps I run on the emulator are fairly slow. Is this a common trend? I do expect emulators, who are by no means a real device, to have such processing delays but are they in general this slow? Any metrics or any other feedback from anyone that depict the factor of slowdowns you would expect on an emulator vs the real device? I know a lot of this are machine dependent as well but consider an idle powerful machine. And regarding memory - I am loading Eclipse with close to 1G to be able to run the emulator and its basic services - is that normal?
View 3 Replies
View Related
Sep 16, 2009
I want to make a tile based game for android. At the moment I am drawing each tile as a separate bitmap. I have a big for loop that reads from a string and draws different tiles depending on what character it finds to draw the level. I have allowed the user to scroll the screen using scrolling gestures. However the game is too slow. It takes a long time to update the screen after the user scrolls. I presume this is because it has to draw each tile's bitmap individually. What would be a faster way to draw the level? I was thinking I could merge all the tiles into one bitmap. But I don't know how to do this.
Anyway here is my code so you can see the problem:
package org.example.tutorial2d;
import android.app.Activity;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.GestureDetector.OnGestureListener;
import org.example.tutorial2d.Panel;
public class Tutorial2D extends Activity implements OnGestureListener {
GestureDetector gestureScanner; Panel main;
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gestureScanner = new GestureDetector(this);
//requestWindowFeature(Window.FEATURE_NO_TITLE);
main = new Panel(this); setContentView(main); }
@Override public boolean onTouchEvent(MotionEvent me) {
return gestureScanner.onTouchEvent(me); }
@Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
main.handleScroll(distanceX,distanceY); return true; }
@Override public boolean onDown(MotionEvent e) { return true;
} @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { return true;
} @Override public void onLongPress(MotionEvent e){
} @Override public void onShowPress(MotionEvent e) {
} @Override public boolean onSingleTapUp(MotionEvent e) { return true; } }
And the class that does all the work:
package org.example.tutorial2d;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.util.Log;
import android.view.View;
import org.example.tutorial2d.Point;
public class Panel extends View {
private int scrollX = 0; private int scrollY = 0;
public Panel(Context context) { super(context);
} @Override public void onDraw(Canvas canvas) {
/*Bitmap scratch; //Drawable scratch;
//scratch = getContext().getResources().getDrawable(
// R.drawable.icon); canvas.drawColor(Color.BLACK);
//scratch.draw(canvas); int origin = 0;
scratch = BitmapFactory.decodeResource(getResources(), R.drawable.horizontal5);
canvas.drawBitmap(scratch, origin, origin, null);
int width = scratch.getWidth(); int height = scratch.getHeight();
scratch = BitmapFactory.decodeResource(getResources(), R.drawable.room4entrynesw3x3);
canvas.drawBitmap(scratch, origin + width, origin - 32, null);
[Code]
View 3 Replies
View Related
Mar 18, 2010
Just got my N1 upgraded to unlimited web use through 3. Had to set up the APN. Did that in work and looked forward to `consuming` on the train journey home.
How cheesed off was I when I got diddly squat in the way of speed and function from the network?!
Endomondo - did not work, no maps
Google maps - never registered my position
Web - realllly slow to load anything
GPS tester - only found one or 2 satellites nd never made proper contact
Anyone else got an N1 with Three? Performace pants? Any other networks just as bad?
View 10 Replies
View Related
Oct 26, 2010
I'm rooted running CM6, have been for awhile. I was just recently installing last.fm and I guess I pressed something that caused my phone to slow way down, pretty much froze up, so I rebooted it. It booted all the way up and then rebooted itself again and now it won't go passed the white htc screen.
View 2 Replies
View Related
Nov 29, 2010
i've found that my x10 really disappointed me even after updated.. still alot of bugs! and so slow~==... that really irritates me alot... SE pls do something to improve the phone as i can see the specification of this phone is really good just that the software sucks. and this phone is not cheap at all. cost me almost like the price of an iphone
View 3 Replies
View Related
Sep 16, 2013
I have upgraded my Galaxy Grand Duos I-9082 from Jelly bean 4.1.2 to 4.2.2 and the phone hangs randomly. on 4.1.2 it was working truly commendable.
View 24 Replies
View Related
Jul 28, 2010
I am currently developing a simple info app on various uni campuses. I want the app to operate predominantly in an offline state thus I want to store all my information locally. The data within the app will not be subject to any change thus I was wondering what the best (practice) method was to store such data? Basically should I be storing the info in a SQLite db, java file or xml?
View 3 Replies
View Related
Oct 17, 2010
I am running eclipse on my windows 7 machine, 6bit with 6gb ram and core 2 duo. I am currently running Eclipse 3.6 and android 2.2 SDK. I am running jdk 1.6. I am noticing that when coding and the context popups to list methods of a class, it hangs Eclipse for up to 15 seconds. This is very frustrating. One thing to note, when Eclipse hangs, my processor is maxed out, and is being worked by a java process. So its doing something whatever it is. But frequently everytime I finish an object with a period and the context box pops up, its becoming too painful to work with.
I changed some settings in the Eclipse.ini file such as:
-Xms1024m
-Xmx1024m
--launcher.XXMaxPermSize 512m
View 2 Replies
View Related
Jun 8, 2010
If I have a bunch of data that is never going to change (eg. an English language dictionary or the rgb values of a couple hundred color names), how do I use an SQLite database to store it? I know a database is faster than loading everything into memory when the app starts, but how do I make the database either the first time the app runs or "before" the apps ever runs?
View 2 Replies
View Related
May 2, 2010
I've started working on some Android applications and have a question regarding how people normally deal with situations where you have a static data set and have an application where that data is needed in memory as one of the standard java collections or as an array.
In my current specific issue i have a spreadsheet with some pre-calculated data. It consists of ~100 rows and 3 columns. 1 Column is a string, 1 column is a float, 1 column is an integer. I need access to this data as an array in java.
It seems like i could:
1) Encode in XML - This would be cpu intensive to decode in my experience.
2) build into SQLite database - seems like a lot of overhead for static access to data i only need array style access to in ram.
3) Build into binary blob and read in. (never done this in java, i miss void *)
4) Build a python script to take the CSV version of my data and spit out a java function that adds the values to my desired structure with hard coded values.
5) Store a string array via androids resource mechanism and compute the other 2 columns on application load. In my case the computation would require a lot of calls to Math.log, Math.pow and Math.floor which i'd rather not have to do for load time and battery usage reasons.
I mostly work in low power embedded applications in C and as such #4 is what i'm used to doing in these situations.
It just seems like it should be far easier to gain access to static data structures in java/android.
Perhaps I'm just being too battery usage conscious and in my single case i imagine the answer is that it doesn't matter much, but if every application took that stance it could begin to matter.
View 3 Replies
View Related
Mar 29, 2009
I have created a broadcast receiver statically by specifying it within the Manifest, and I have also created the "same" broadcast receiver in code and have registered it with the application context. The static way works very well, but the dynamic way does not receive the expected broadcast. It could be that I am not creating the intent filter correctly, or that I need to register it with some other context somewhere. Please see the code examples to see what I am doing. This is related to receiving data SMS, it works very well on a device using a broadcast receiver defined in the Manifest. The correct permissions are set for both examples.
The following is from the Manifest, and the resulting receiver gets the expected broadcasts:
CODE:.....
The following is the code example that doesn't work (it does work with an intent like "android.provider.Telephony.SMS_RECEIVED" but not for data sms):
CODE:.....
The question is - why does this broadcast receiver get notified of the incoming data messages? It seems some other resource is notified when the Manifest version of the receiver is created...
View 4 Replies
View Related
Mar 30, 2010
i want to display a msg to the user (msg box or Toast) when exception happend in a static SQLite Database class that i use. the problem is that i cant call a non static method in a static class , how can i handle this. this is the class
private static SQLiteDatabase getDatabase(Context aContext) {
and i want to add something like this in the class when exception happen but context generates the problem of reference to non static in static class.
Context context = getApplicationContext();
CharSequence text = "Hello toast!";
int duration = Toast.LENGTH_SHORT;
Toast toast = Toast.makeText(context, text, duration);
toast.show();
View 1 Replies
View Related
Feb 7, 2010
I'm having some issues with the old "Cannot make a static reference to a non-static method" error in my Android program. I am creating a sand falling game (similar to the Powder Game) and I created a class called Control to create a Control Bar at the bottom of the screen with a slider for brush size (that works fine) and a button to pop up a Dialog to allow users to pick the selected element. However, when I call DemoActivity.showDialog(2) from my code, it gives the static reference to non-static error (DemoActivity is the main activity of my application). I also tried changing it to just Activity.showDialog(2), but I got exactly the same error!
Here's my code:
CODE:................
I fixed it by adding the following to my Control.java code:
CODE:..........
And then calling control.setActivity(this); from my onResume section of DemoActivity.java!
View 2 Replies
View Related
May 26, 2010
I am modifying the source code here: http://thinkandroid.wordpress.com/2009/12/30/getting-response-body-of-httpresponse/
I get this error:
code:.............
This error is line 13 on the second box.
View 5 Replies
View Related
Oct 27, 2010
In my application, I am going to create a few listviews that are dependent on the listview before it. For example,Then, depending on user choice, will go next screen, let's say, it contains a submenu of each type of school,that may be different or may be the same to other states.What I want to know, is how to populate these different lists dynamically as the user goes on? I don't know what the best of doing this is, and I seem to be looking in the all the wrong places because I keep getting stuck. Once all the data is added into whatever structure is used, it will be static. I basically just need help as to how to code information into some sort of hashtable or anything of the sort that can be easily referenced, and later when the Application is updated, be able to add more schools/states/submenus etc.
View 1 Replies
View Related
May 23, 2010
I'm looking into writing an Android game, tough I don't curerntly own an Android device. For those of you who own a device, how does the performance on the emulator relate to real device performance? I'm especially interested in graphics related tasks.This obviously depends on both the machine running the emulator, and the specific device in question, but I'm talking rough numbers here.This question is a duplicate, but since that post is heavily outdated, I figured it's irrelevant by now.
View 3 Replies
View Related
May 19, 2013
I need to know why my data speed is so slow. What can I do?
View 1 Replies
View Related
Jul 31, 2009
I have some reference data in a text file (~5MB) that I want to use with might android application.The file is of the format:
1|a|This is line 1a
1|b|This is line 1b
2|a|This is line 2a
2|b|This is line 2b
2|c|This is line 2c
What I want to know is the most efficient way (less memory, fast, size etc.) to use this file within my application.
a.) Should I save the file as a raw resource and open and read the whole file whenever I need a certain line.
b.) Should I convert the file to XML and use XPath to query the file when ever I need to look up a value
<!--sample XML -->
<data>
<line number="1">
<entry name="a">This is line 1 a</entry>
</line>
</data>
c.) Should I just copy & paste the whole file as a static string array in the application and use that.
[EDIT] I will also need to search this file and jump to arbitrary keywords e.g. "line 1a".
View 4 Replies
View Related
Mar 9, 2009
I have been finding it convenient to extend Handler in many of my activities to handle messages specific to the activity. The handler sublass is an inner class of the activity and needs to access its state. I am wondering if there is any performance difference between making the handler subclass static and passing in the activity explicitly in its constructor or making the subclass an "instance class" and letting the vm worry about my accessing members of the containing activity.
The static approach:
CODE:.............................
View 4 Replies
View Related
Feb 20, 2010
Motorola CLIQ Over-the-Air Update
[Retail Partner Sales - T-Mobile Employees and Authorized Dealers]
February 19 Update
The over-the-air update for the Motorola CLIQ has been delayed to the week of February 22. An updated article will be available once a date has been determined.
On February 18, Motorola will begin sending over-the-air (OTA) software updates to Motorola CLIQ customers. The software update will improve device performance and resolve several known issues.
Improved Performance:
Improved battery life
Improved software performance and stability
Improved widget response
Decreased Force Close error messages
New Manage SIM Card application
Support of .WMA and .WAV media files
Removal of the imeem mobile application
Known Issues Resolved:
Accessories & Bluetooth
Error: 'Unable to pair' or 'Unable to connect to device'
Call functions
Can activate other functions while listening to visual voicemail
Call not ended by pressing the End key
Speakerphone turns on unexpectedly when answer incoming call
Plays ringtone or vibrates while on an active call
Unable to answer incoming call using �Slide to answer� feature
Accidentally opens Dialer or makes outbound while holding device
Device hardware (battery, keys, power, screen)
Battery indicator may not display accurate battery power
Call not eded by pressing the End key
Touch screen issues
Cannot answer incoming call using the Slide to answer feature
Incorrect keys registered using on-screen keyboard
Touch display appears to have �dead spots� that are unresponsive
Accidentally selects item when trying to flick through screens or menus
Messaging
Wrong message deleted
Phone may reset when turning Wi-Fi off in area with no Wi-Fi coverage
Customers can manually download the OTA on demand by going to Settings > About Phone > System Updates. Customers do not need to wait for a notification message to download.
Action Steps
Be aware of the fixes and enhancements included in the Motorola CLIQ update.
If customers are experiencing any Known Issue that will be resolved by the software update:
Do not file a handset exchange
Advise customers that the issue will be resolved by a software update on February 18.
Important Rebate Changes
[Retail Partner Sales - T-Mobile Employees and Authorized Dealers]
Customers eligible for rebates as part of new activations or upgrades must be advised they will receive their rebates in the form of a prepaid Visa card.
When customers take advantage of our new Early Upgrade or Early Upgrade Plus options, they are not eligible for upgrade rebate cards. These new upgrade options allow customers to take advantage of upgrades sooner and provide an instant discount, instead of having to wait for rebate cards.
To be eligible for an upgrade rebate card, customers must meet upgrade eligibility requirements.
Current, 1-year contracts: 11 or more active months since last discounted handset purchase.
Current, 2-year contracts: 22 or more active months since last discounted handset purchase.
Rebates on eligible purchases require contract extensions and a $9.99 or higher Data/Messaging feature.
Valid only on FlexPay plans with 1 or 2-year contracts.
Not valid for Even More Plus plans.
Active Months: The number of months in which the account has been in good standing and during which service has not been suspended.
Action Steps
Inform customers that Early Upgrade and Early Upgrade Plus are not eligible for upgrade rebate cards.
Advise customers eligible for rebates that they will receive their rebates in the form of a prepaid Visa card.
"With the purchase of your new handset, you can submit a rebate form to receive your rebate. The rebate will be in the form of a prepaid Visa card that can be used anywhere Visa is accepted. See the rebate form for additional details."
Trackball Replacement Program
[Retail Partner Sales - T-Mobile Employees and Authorized Dealers]
On February 24, T-Mobile will launch a Trackball Replacement program for BlackBerry Pearl 8100/8120 and BlackBerry Curve 8320 customers that are having trackball issues. This program will be available in T-Mobile retail stores only at this time.
Action Step
Refer customers to a T-Mobile retail store after February 24 for further assistance if they come in to your location looking to complete a trackball replacement.
First Connect for Dealers
[Retail Partner Sales]
First Connect for Dealers is an exciting class designed to help on-board and prepare Retail Partners to successfully sell T-Mobile products and services and provide differentiated customer experiences. This four hour class is conducted via the T-Mobile Live Virtual Classroom and covers the following:
Welcome to T-Mobile
Who is T-Mobile?
PCC
Differentiated Handsets
Differentiated Rate Plans
Service Excellence / Selling Skills
Tools and Resources
Customer On-Boarding
The attached flyer contains dates and times for these calls as well as registration details. ADRs should educate their locations about these calls and encourage them to attend.
To successfully be able to attend the training sessions, Retail Partners should have the following:
Computers with high speed Internet connections
The ability to play and hear video segments on the computer using speakers or headset
The use of a fully charged mobile phone to hear the audio portion of the conference call
Printer access to print Participant Workbook.
Action Steps
Share the attached flyer with your locations and encourage them to attend one of the scheduled calls.
View 1 Replies
View Related
Aug 16, 2010
I've noticed on my DX, often if I try to go to a website, the market, or google maps, it'll take a REALLY long time to start working. Even when my 3G light is on, and the down arrow is black, it just sits there.Sometimes the website will say no data connection available, but this is even when i have wifi turned on!I thought this was JuiceDefender so I uninstalled it, but I'm noticing I still have the same problem. I don't want to show off my DX to iPhone friends and have it's not working this time.." moment!
View 5 Replies
View Related
Jun 30, 2010
right now i am trying to transfer 2.85 gigs onto the droid, its going at 315kb/s. is it cause of the new froyo leak or is something else wrong? im using the stock cable with stock memory card in my stockings.
View 3 Replies
View Related
Aug 17, 2010
Some professional reviews (engadget and phonescoop) have noted signal strength issues with the Droid 2. For example, see:
Review: Motorola Droid 2 : The Three S's (Phone Scoop)
Particularly for those who have/had other Verizon phones, have you noticed any signal strength problems, trouble with calls, or slow data?
View 4 Replies
View Related
Apr 14, 2009
I am trying to connect a AutoCompleteTextView with a SimpleCursorAdapter, which narrows down the selection of a list of words, when the user starts typing.
Following some other posts here, I've come up with the following code, but it doesn't work. I defined a FilterQueryProvider runQuery() method for the SimpleCursor Adapter, but when I use the debugger in the code, the response from the ContentResolver.query((0 method call is null.
I think the problem is that there is no relationship between the CONTENT_URI and the SQL database, but I can't be sure.
CODE:.......................
View 2 Replies
View Related