android,appwidgetRelated issues-Collection of common programming errors
Padma Kumar
android android-camera
I am developing an application that starts capturing images automatically every 4 secs after when i click the button once.. But I am getting error.. Here is what I am doingbuttonClick.setOnClickListener(new OnClickListener() {public void onClick(View v) {new Thread(new Runnable() {public void run() {while(true){preview.camera.takePicture(shutterCallback, rawCallback,jpegCallback);try {Thread.sleep(4000);} catch (InterruptedException e) {// TODO Auto-generated catch blocke.printStackTrace();}}}})
Deepak
android encryption sqlcipher
I have using Sqlcipher for my database encryption. I am using SQLiteDatabase.openDatabase for creating, editing and read the sqlchiphered database. I could open ,read and edit properly but suddenly i got the follwing error and after that i couldnt open the database itself 12-25 17:59:07.961: E/Database(6794): SELECT locale FROM android_metadata failed 12-25 17:59:07.961: W/System.err(6794): net.sqlcipher.database.SQLiteException: file is encrypted or is not a database 12-25 17:59:07.966: W/Syst
user1145533
android multithreading android-ndk jni
My application makes multiple calls from native threads to java, i am seeing the memory usage of the application slowly creeping up. It looks like the calls to attach and detach cause JAVA to leak a thread. I can see this by running DDMS memory analyser.I have written a really simple test app that demonstrates my issue, start test is called from JAVA and kicks off the thread. It doesn’t do anything other then attach and then detach the worker thread.void detachFromThread(JavaVM *vm) {if(vm != NU
Jane Wayne
android python monkeyrunner
i have the following python script in an attempt to take a screen shot of a device (not an emulator).import sys import timefrom com.android.monkeyrunner import MonkeyRunner, MonkeyDeviceCONNECTION_TIME_OUT = 30 deviceName = str(sys.argv[1]) pathName = str(sys.argv[2])device = MonkeyRunner.waitForConnection(CONNECTION_TIME_OUT, deviceName) result = device.takeSnapshot() result.writeToFile(pathName,’png’)i run this script at the windows command prompt as follows.monkeyrunner.bat -v ALL %SCRIPT_DIR
Cy Kaustav
android phonegap extjs gcm
Hi i have already built the native GCM application for Android which is working very fine in all my android devices. But i want to further use this GCM service like i want to integrate this GCM service with my existing Android app as for for testing i have already done my server for GCM but i am lagging behind all because of the Client side implementation. i have been trying to get the relevant information regarding my project but i couldn’t be able to find an resource of Client Side Implementat
genpfault
android animation video text opengl-es
We are trying to create a text animation like Transition and Zoom on the Video. We are not able to get Smooth transition and the effect is so jerky. Then we understood sub pixel rendering is not possible in android. What alternatives can we think of? Can we solve this problem in OpenGL?Ok… I would like to add more to my question….We are actually trying to implement text animations on top of a video which is played by a native player on a surface view. We tried to achieve the text animation
tazeenmulani
java android sqlite
I work with SQLite database in my Android application.I want only one column retrieved in spinner.When i run the application ,the application is crash.And my log cat shows “Bad request for field slot 0,1. numRows = 1, numColumns = 1”.Below are the codes for retrieving data from database and put it into spinner(NewleadActivity.class).This is my Adapter classpublic class DbHelper extends SQLiteOpenHelper{// Database Version@SuppressWarnings(“unused”)private static final int DATABASE_VERSION = 1;//
Santhosh
java android inputstream ioexception processbuilder
making a class , with several functions , I am having a problem with one of these functions which will use the ProcessBuilder to send a command and take its output as a string , acting as a shell command . When I use it , it catches an IOException , with a Bad file number , at the InputStreamReader , and returns “ERROR!!!” , here is my code , if you need to know anything about this comment … I am using the command “ls” btw , “ls /sdcard/” …public String builder(String str) { startTimer();
Kara
android out-of-memory
I am developing an Android Application to load some images to emulator, but it fails with the below error:11-07 19:38:51.596: E/dalvikvm-heap(322): 73670400-byte external allocation too large for this process.11-07 19:38:51.596: E/GraphicsJNI(322): VM won’t let us allocate 73670400 bytes11-07 19:38:51.596: D/AndroidRuntime(322): Shutting down VM11-07 19:38:51.616: W/dalvikvm(322): threadid=1: thread exiting with uncaught exception (group=0x4001d800)11-07 19:38:51.926: E/AndroidRuntime(322): FATA
Patrick Mahoney
android toast android-xml
I know that I could do all of this easily with a custom toast layout, but in creating a custom layout, I would no longer be using the system’s default toast view.Example: Toasts of course look different in Android 2.2 vs Android 4.0. If I create a custom view for my toast, then it will look the exact same in both versions, but what I want is for it to retain its… “Androidiness” for lack of a better word. Basically, does anyone know of a default toast XML layout? Is that even possible?
ManicBlowfish
android resources android-widget appwidget
I need to determine the screen density at runtime in an Android AppWidget. I’ve set up an HDPI emulator device (avd). If set up a regular executable project, and insert this code into the onCreate method:DisplayMetrics dm = getResources().getDisplayMetrics(); Log.d(“MyTag”, “screen density ” + dm.densityDpi);This outputs “screen density 240” as expected.However, if I set up an AppWidget project, and insert this code into the onUpdate method:DisplayMetrics dm = context.getResources().getDisplay
Jose_GD
android appwidget viewstub
I wonder whether it’s possible to inflate a ViewStub using a layout with unsupported views inside an Android appwidget (for example, an ScrollView or WebView).I know that only views with the @RemoteView annotation in its declaration are available to the RemoteViews mechanism, but this restriction remains when inflating layouts at runtime?
Karakuri
skaffman
android appwidget
In my app widget, I have a LinearLayout whose height and width are set to fill_parent. Is there a way to get at runtime, the actual size that has been allocated to this view?
rgrandy
android android-widget screen-orientation appwidget
I have code in an appwidget that I want to run when the phone’s orientation changes on the home screen, ie like when the keyboard flips out. I have an image that I want to change in an imageview in my appwidget. I can’t use different layouts linked to the orientation (ie “layout” and “layout-land”) because I don’t know the name of the image file until runtime, it is created at runtime. Is there anyway to trigger code to run only if the home screen is shown, my appwidget is active and the orienta
Frozen Spider
java android resize appwidget
I know that one cannot change the size of an app widget. But what to do if I need to? I know that there can be several receivers in AndroidManifest.xml, each with its own provider_info.xml, but users can switch between them only while adding widget on the homescreen. Is there any way to switch between different app widget providers at runtime?
Oliver
android appwidget
Dear all, I am trying to set the position of a TextView within an appwidget. Basically, the direct access to properties af the TextView works:myRemoteView.setTextColor(R.id.myTextView, Color.WHITE); //worksAlso indirectly, I can access the TextView properties:myRemoteView.setInt(R.id.myTextView, “setTextColor”, Color.BLUE); // worksAnd setting float values also works:myRemoteView.setFloat(R.id.myTextView, “setTextSize”, 25); // worksNow I’m trying to shift the x position of the TextView by 5 p
wufoo
android service appwidget
I have an android Activity extending AppWidgetProvider in which I’d like to keep a count of how many times onReceive() is called. The problem is, every once in a while there is an entry in Logcat saying “No longer want blah.foo.bar.baz” and shortly afterwards an entry saying “Scheduling restart of crashed service blah.foo.bar.baz”. Android kills and then restarts my process which causes all my variables to initialize to default values. Only way I can think of to maintain variable state is to wr
Santhosh_pulliman
android appwidget backlight screen-brightness
I have created a simple Appwidget to control the brightness of the screen by this code:android.provider.Settings.System.putInt(context.getContentResolver(), android.provider.Settings.System.SCREEN_BRIGHTNESS, 50);When i click the widget, there is no change in the brightness of the backlight immediately. But when i lock and unlock the phone, it works. I read Changing screen brightness programmatically (as with the power widget) that using dummy activity will give the solution. So i created an act
Aakash
java android appwidget
What am I doing?I am updating an AppWidget using an IntentService. What is the problem?Everything works perfectly well except for some rare times probably every 12-15 hours or I might say random, the widget updates don’t happen. After debugging through the situation here is the logcat message which appears to be the problem.05-27 20:21:13.122: WARN/ActivityManager(97): Scheduling restart of crashed service com.myapp.android/.myAppWidget$UpdateService in 5000msBelow are some more logcat messages
Web site is in building