android

making android emulator work for 1600x1200

I've tried editing android's skin layout in the emulator to be 1600x1200 and the emulator fails to bring up a window. It works fine for smaller resolutions like 1024x480 and such but not big resolutions. Although even with 1024x480, part of the emulator window is inaccessible and not visible. My question is whether anyone has made this w...

Synchronise ScrollView scroll positions - android

Hi, I have 2 ScrollViews in my android layout. How can I synchronise their scroll positions? ...

Android ArrayAdapter & ListView slowness

Hello, To display & load images in my ListView I've created a custom ArrayAdapter, however it is really slow. Every time I scroll through the list it loads the images again. Is there a caching mechanism which will cache my Views so I don't need to refill them every time? I know about the ViewHolder method, however this still is slow or...

Union of Tables with Cursor in Android

Hi, I am trying to UNION two tables with the same fields to create a single cursor (through a content provider) that I am using to create my ListView. @Override public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { SQLiteQueryBuilder qb = new SQLiteQueryBuilder(); Stri...

Injecting CSS rules into the page in Android Browser

I'm writing a JavaScript to inject a new CSS rule into pages in Android browser in order to display some text in a custom CSS font (after some replacement). Here is how I tried to inject the CSS rule: var css = '@font-face {font-family:"font"; src:url(http://www.example.com/font.ttf);} si{font-family:"font"}'; if(document.getElementsBy...

How to Send the Current Thread to Sleep

Thread thred = new Thread(); thred.run(); public void run() { while (true) { try { Thread.sleep(500); Toast toast = Toast.makeText(getApplicationContext(), "Sleep Over", 100); } catch (InterruptedException e) { // TODO Auto-generated catch b...

Programs running aapt in android sdk from shell and from sbt.

I have a weird problem where I cannot run aapt from an sbt command as well as from the shell. I run this command: sbt update package-debug And everything hums along until I get this error: java.io.IOException: Cannot run program "/home/egervari/Programs/android-sdk-linux_x86/platforms/android-7/tools/aapt": java.io.IOException: error...

Android Debugging with Eclipse on my HTC Evo: Augh!

I've turned on USB debugging. I have the latest HTC Sync and android SDK components. I'm using Eclipse 3.5 on windows XP. I'm running Android 2.2, and am asking for 2.1 as the minimum in the debugger. I work in Eclipse/Java just about every day, and have for several years. I'm even writing an Eclipse plugin at work as I type this......

Android - Brain Cramping

Alright, I have a simple boolean at the top of this class, standing. In the thread, I have the following code: @Override public boolean onTouchEvent(MotionEvent event) { if(event.getAction() == MotionEvent.ACTION_DOWN) { if(standing == true){ player.handleActionDown((int)event.getX(), (int)event.getY()); ...

How to set Text for TextView so that it will appear from Top left through Code in Android

How to set Text for TextView so that it will appear from Top left through Code in Android not by XML. Thanks in Advance? ...

where do the tables created using SQlite database will be stored in Android?

where do the tables created using SQlite database will be stored in Android? how to access them and see the data contained in them. ...

Create objects to represent database's tables.

Hello. I'm developing an Android application. I'm wondering if it really necessary to create objects that represent tables from a SQLite database. I'm implementing insert method and instead using a specific object for a table, maybe I can use a HashMap. This Hashmap will be an argument for that method. public boolean insertEntry(Hash...

How to send an SMS to several users in Android

Hi! If I have a list of numbers how can I send an sms message to them using Android SDK. Thanks. ...

how to reduce native heap usage in google map for android ?

Hi everyone, 10-15 14:43:43.020: ERROR/dalvikvm-heap(299): 32768-byte external allocation too large for this process. 10-15 14:43:43.020: ERROR/GraphicsJNI(299): VM won't let us allocate 32768 bytes 10-15 14:43:43.260: ERROR/AndroidRuntime(299): FATAL EXCEPTION: main 10-15 14:43:43.260: ERROR/AndroidRuntime(299): java.lang.OutOfMemo...

What's wrong with the Thread?

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Thread thread = new Thread(){ public void run() { try { sleep(50); Toast toast = Toast.makeText(getApplicationContext(), "Logged In", 100); toast.show(); } catch (In...

Set size on char array in Java

Hello. I'm developing an Android application. I want to set size to a char array like this: public char[5] language; But it doesn't work. I have to delete number five to make it work. I want to limit to five characters to language variable. How can I do that? Thanks. ...

Can my HTML5 canvas effects run on iPhone or Android?

I design a HTML5 canvas effects homepage on my site http://catfan.me You can click the sky and add a cloud, and It`s able to show the fps. It runs perfect on HTML5 supported browser, such as Chrome, FireFox, Safari, IE9.. But i do not know if it run on iPhone, iPad or Android mobile phone. I didn`t have this devices. Can anyone to he...

best way to implement a list of special UI elements ??

Hi, guys. I need an advice. What is the best way to implement in android a list of such UI elements (see the ref) A list contains a lot of such elements (about 30-40). I'm using now relative layout and 4 text fields and I think it isn't a good way... I think it's too heavy (full list will contain: 30 relative layouts and 30*5 = 150 text ...

The efficiency about android canvas drawing

Hi, I've been wondering if canvas has a limit boundary. I mean if I use functions such asdrawline(), drawbitmap(), drawcircle(), does android really draw something on the canvas and waste some CPU cycles?? because after all the drawing functions, the actual picture print on the screen is decided by the screen size. And if I draw on som...

Exception is NULL always

Hello all, Can someone explain to me why the Android "Catch" handler will not initialize an Exception object? When an error occurs and my code is trying to initialize an Exception object it is ALWAYS NULL. The above doesn't make sense to me because the exception should always initialize the Exception object period. It should never be n...