android

Will WebView cache persist between application runs?

Hi, I have a WebView. I'm not quite sure how caching works for it. Ideally I'd like to load a webpage from the network once (images included), then from then on only ever load it from the local cache. I'm not sure if we have this level of control over webview. Will it at some point just auto-clear the cache? How could I tell? I need to ...

CacheManager.getCacheFileBaseDir() always returns null

I've been trying to use the CacheManager for caching some http requests but it failed every time with a nullpointer exception. After some digging I believe I found out why: CacheManager.getCacheFileBaseDir() always returns null so when I try to use CacheManager.getCacheFile() or CacheManager.saveCacheFile() they fail. CacheManager.cach...

How to grey out spinner in Android?

I use two Spinner in my App. One of them is initially disabled because I need the user to select something in the first spinner to load the content of the second one. I would like to change the design of the second spinner to show the user that the spinner is not active, eg. grey the spinner out. How can I achieve this? If this is not...

How to gain greater control of network packets on Android

I'm looking to design an application that will require some deep control over IP packets. Looking over the reference guide on the developers site at Android I see very limited control over packets from java.net:SocketOptions and java.net:DatagramPacket. Specifically I'm looking to control the individual bits within the packet to set TCP ...

Display pdf within app on android?

I got very frustrated when I realized that android is not able to display pdfs (in a webview or whatever) out-of-the-box. So my question, are there any (os) jars or classes to display a pdf document within an app? Has anybody experience with using some of the standard java pdf viewer libraries on Android? The libraries don't need to be...

Simple 2D tile not rendering on Android...

I'm putting together a simple test made up of two tutorials available online for OpenGL ES on Android. This is really just so that I can learn about the basics of OpenGL ES to better understand how I have to design my program. Right now, when it tries to render, the mouse movement effect works, but I get no square drawn on the screen. ...

Is there a way to create a new user account within Android ?

I'd like to be able to create a special user account that would exist on an android device. Since it is based on the Linux kernel, I was hoping there was a way to create a group account and then create a user account. Is it possible ? ...

Approach for fixing NoClassDefFoundError?

I'm seeing this question is getting asked a lot in many different contexts. Perhaps we can set some strategies for locating and fixing it? I'm noobish myself so all I can contribute are horror stories and questions, sorry... It seems this is thrown when a class is visible at compile time but not at run time... how can this happen? In...

Problem in DialogPreference

Hi, My problem is the following : I have a component that extends DialogPreference, if I change the associated preference from other part than the UI, with SharedPreferences.Editor ed= sharedPreferences.Edit(); ed.putInteger("Setting",aValue); ed.commit(); then when I open the dialog the selected preference is not changed accordingl...

How to compile all source files (default make target does not compile all of them)

Hi, when I compile android (http://source.android.com/download) it does not compile some source files. For example there is external/bluetooth/bluez/sbc/sbc.c which is not compiled. There are also other such files. It's possible those files need not to be compiled. Or it might be that I need some special configuration to compile them....

Android - Camera Preview

Hi, i'm trying the camera preview This is my code and it doesnt throw any error, but the screen still black, any ideas? this.setContentView(R.layout.camerapreview); SurfaceView cameraSurface = (SurfaceView)findViewById(R.id.cpPreview); SurfaceHolder holder = cameraSurface.getHolder(); holder.addCallback(this); holder.setType(Surfac...

Receive explicit intent. Android.

Is it possible to receive an explicit intent with the component option set? Example: Starting activity: Intent { action=android.intent.action.VIEW data=http://example.org flags=0x10000000 comp={com.android.browser/com.android.browser.BrowserActivity} } The reason why i want to this this is because i want receive this intent above, lau...

Android: Get the scroll position of a WebView

I'm new to Android. I would like to simply know where on a page the user has scrolled. When a certain point on the web page appears at the bottom of the screen, I want to trigger an event. But this code causes an exception. I know that WebView inherits getScrollY() from View. Am I not implementing it correctly? Thanks in advance. publ...

android Get the azimuth of phone when picture was taken

I can use the SensorManager and SensorEventListener to get the azimuth. I am wondering if the built in Intent to capture an image provides the azimuth or orientation? Thanks Jon ...

How does one declare the type of an Android preference?

I have a preferences.xml that looks like this: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"&gt; <EditTextPreference android:name="Sample" android:enabled="true" android:persistent="true" android:summary="Sample" android:defaultValue="3.0" android:title...

Android Image Problem and threshold

Hey Guys, Long time reader never posted until now. Im having some trouble with Android, im implementing a library called JJIL its an open source imaging library. My problem is this i need to run some analysis on an image and to do so i need to have it in jjil.core.image format and once those processes are complete i need to convert th...

Android:Multi touch event handling is supported in Android 1.6 SDK?

Friends, I like to know using which version of Android SDK we can develop multi touch handling. Does Android SDK 1.6 support multi touch? If yes, can i get some sample code, where i can have multiple imagebuttons placed on screen and clicking on all the imagebuttons at a time should detect multiple touch events? Thank you. ...

menuitem id in xml format can't be an integer? huh. really?

ok, in menu.add, you add an integer menuitem id. But when you specify the menu in xml, @+id can't take an integer, so you can't test the id for the menu item as an integer in a switch statement. What obvious thing am I missing, because surely an inconsistency this bone-stupid couldn't have passed muster with all those wonderful geniuse...

How do I change the number of thumbnails seen in the Android sample Home application?

I am working with the sample Home application project on http://developer.android.com/resources/samples/Home/index.html I've added another value to the THUMBS_IDS and IMAGE_IDS Integer arrays in the Wallpaper class for a total of four wallpaper options. When I run the application with Device API version 7, Skin: HVGA, hw.lcd.density: 1...

Efficiently sending protocol buffer messages with http on an android platform

I'm trying to send messages generated by Google Protocol Buffer code via a simple HTTP scheme to a server. What I have currently have implemented is here (forgive the obvious incompletion...): HttpClient client = new DefaultHttpClient(); String url = "http://192.168.1.69:8888/sdroidmarshal"; HttpPost postRequest = new HttpPost(url); ...