android

android excessive global references

Hello guys. I'm occassionally tripping the jni global reference limit for the android emulator. I'm trying to store around 2000 words along with definitions in my application and it's failing at either of two spots: if I use DOM to parse the xml file with all those references it fails when DOM pulls the tree into memory. If I use SAX...

PathIterator in android?

Is there anyway to iterate a Path in android? To retrieve the individual "moveTo", "curveTo", "lineTo", etc., commands? I need to be able to generically create shapes to be drawn to a canvas. The Path class does this well. But, I also need to be able to retrieve the individual commands used to create these shapes, so I can persist th...

"Email" app appending text to URL

When a user clicks on a link in an email in Android's "Email" app, when it launches in the browser, the URL has the following string appended: %3E%C3%82%C2%A0%C3%82%C2%A0%C3%82%C2%A0%C3%82%C2%A0%C3%82%C2%A0 This, when the URL-safe encoding is removed, is junk. >� � � � � Any idea why this is being appended, or where it come...

Android Broadcast UDP Looping

Hi all, I am currently sending out a DatagramPacket on a DatagramSocket and I receive just fine.. the problem is that I am receiving the packet I sent out. If I call the receive twice then it times out. Is there a way to ignore the first packet and receive the second. Here is my code.. socket = new DatagramSocket(8001); ...

Absolute position of views to match background jpg

So i have a background image. I have to place some Views over the image so that they "cover" specific points on the jpg. (Think of a background GUI decoration where i overlay the real controls). What's the best way to do this? I'd like Android to take care of all the resizing needed, both of the components and the background. I manage...

android + mapview large amount of marquers

I have been following the hello mapview tutorial In the tutorial they use a custom implementation of the ItemizedOverlay class. I tried using this approach but I am getting very poor performance when I add a large number of OverlayItems. This leads me to think that the tutorial I used is not best suited for my needs. Can anyone point m...

Can one prevent words from breaking in textview when using wrap_content in android

I am in the process of trying to convert a desktop app to Android - and am struggling with some very basic stuff. When I specify a layout including a textview that holds a sizable amount of text wrap_content seems to arbitrarily break in the middle of a word - and I can not find any documentation indicating this can be controlled. ...

How to determine the sender of Broadcast Intent

I have an application that is at the same time a broadcast sender and receiver of standard action android.intent.action.SET_WALLPAPER. I want to do some stuff only in a case when another application broadcasted this intent. Is there any way to determine who initiated a broadcast in onReceive method of a BroadcastReceiver? ...

How careful should I be with thread-safety when creating methods/activities which interact with SQLite database?

I am creating an app which allows for many different Activities to be started from a TabActivity(up to ~25). Most of the activities require data from the sqlite database, so when onCreate is run, an AsyncTask creates an SQLiteOpenHelper object(which will open a readable/writable database), runs a query, data is retrieved, and everything...

Problem with crash with ItemizedOverlay

Hi, I have been trying for hours to figure out why I can not use an Itemized Map overlay without doing this before adding it to the ovelays of the map: GeoPoint point; OverlayItem overlayitem = new OverlayItem(point, "",""); MarkerOverlay.addOverlay(overlayitem); If i try to do this without the MarkerOverlay.addOverlay(overlayitem); c...

AdMob Android requesting ads while program is not in view

Hello I am having a problem trying to stop adMob from requesting new ads. If a person hits the back key or home the application goes to sleep, but admob continues to request new ads. The only way it stops is if the user selects quit from the menu. Does anyone know of a way that in my onPause method I could do something such as ad.pause...

Compiling a large C++ library into Android NDK using JNI - Makefile Questions

Hey everyone, I'm trying to compile a C++ library (VRPN) with a couple of Java wrappers to be used in an Android app. Using the ndk-build command, I get an "undefined reference" error for the first line of my C++ interface file which references a constructor for an object in the library. I am fairly sure my code is correct - the call ...

Android Menu XML : Error Parsing XML:unbound prefix (not xmlns:android ???)

<?xml version="1.0" encoding="UTF-8"?> <menu xmlns:android="https://schemas.android.com/apk/res/android"&gt; <item android:id="@+id/options" andoid:icon="@drawable/icon" android:title="@string/main_options" /> </menu> i keep getting the "Error Parsing XML: unbound prefix" This usually happens when the xmlns:android is missing, bu...

Android get bps from audio sample

Hello all, I would like to make an android application that opens the device microphone and records same samples, my question is if it is possible to know the bps(bits per second) of the recorded audio file. Also is this possible to do from a file stores on the sd card? regards maxsap ...

What record formats are available in Google Ion not listed in core formats?

Looks like the only way to record something is the narrowband codec at 12kbps and 8khz sample rate. Surely audiorecord isnt limited by these rates is it? Where do I look? HTC sapphire source? ...

TextUtil.concat not preserves hyperlinks

For example code below works right CharSequence text = TextUtils.concat( "before ", Html.fromHtml( "<b>This works</b>"), " after " ); myTextView.setText(text, TextView.BufferType.SPANNABLE ); If i put an hyperlink in the html code, i.e CharSequence text = TextUtils.concat( "before ", Html.fromHtml( "<a href=\"www.google.it\">Google</...

Orientation specific failure in ListView.layoutChildren -- exception ArrayIndexOutofBoundsException

Hello. I am a very green android developer and need some help with a strange program crash. Often the program will run just fine. There is an equal chance it will fail (see stack at the end). I can watch the program run through the getView function and everything seems in order (i.e. all the information is there as expected and passes...

Asynchronous Sockets implementation on Android

In iPhone there is Cocoa Asynchronous socket library. Is there a similar library in Java for Android? Can it be done using Java Asynchronous sockets(NIO library) or is there a way I can make use of NDK for Android and use native libraries for asynchronous sockets? ...

What is meaning of boolean value returned from an event-handling method in Android

In android, most event listener methods return a boolean value. What is that true/false value mean ? what will it result in to the subsequence events ? class MyTouchListener implements OnTouchListener { @Override public boolean onTouch(View v, MotionEvent event) { logView.showEvent(event); return true; } } ...

Android - refresh view for one Tab from another Tab

I'm developing an Android application, and I have a 2 tabbed interface, created by having separate TabSpec's for each tab within a TabHost. I have separate activities for each Tab - let's call them TabPhotos and TabAlbums. The layout for each tab is a ListView of records (e.g. photos and albums, respectively). From the TabPhoto context ...