android,android-cameraRelated issues-Collection of common programming errors


  • PX Developer
    android exception android-asynctask sharedpreferences
    I have an application that stores some data in SharedPreferences. This control data is synchronized with a server, and when the user logins in the application I retrieve it using an AsyncTask. I’m trying to store the data retrieved in SharedPreferences again, but I’m getting a java.lang.ExceptionInInitializerError. This is the AsyncTask code:public class RetrieveLogTask extends AsyncTask<Void, Void, Boolean> {private String errorMessage;@Overrideprotected Boolean doInBackground(Void… par

  • user2237853
    android ubuntu adb android-studio
    When I go to install the packages from with Android Studio I get a “ADB not responding” error with wait/restart/close options. I can run adb from a term. I can see my device and install the apk from the cmd line, but it doesn’t work from within Android Studio.In the terminal (that is running Android Studio) I get the following 03:56:36 E/adb: Unexpected exception ‘Cannot run program “/media/5b317046-147a-42ee-aec1-f73caf1922c5/home/kloud9/WorkSpace/downloads/workspace/android-studio/sdk/platform

  • Mohit
    android optionmenu
    flipper = (ViewFlipper) findViewById(R.id.vFslideshow);flipper.setOnClickListener(new View.OnClickListener() {@Overridepublic void onClick(View v) {flipper.showNext();}}); }@Override public boolean onPrepareOptionsMenu(Menu menu) {if(flipper.isFlipping()){menu.removeItem(0);}else{menu.removeItem(1);}return true; }@Override public boolean onCreateOptionsMenu(Menu menu) {menu.add(0, 0, 0, “start slideshow”);menu.add(0, 1, 1, “stop slideshow”);menu.add(0, 2, 2, “close”);return super.onCreateOptions

  • ophilbert
    android android-layout rotation android-animation rotateanimation
    I’m trying to make an animation on a layout that has been previously rotated using RotateAnimation. The animation i want to do are fadeIn and FadeOut depending of the situationaLayout = (LinearLayout) _context.findViewById(R.layout.layoutId);AlphaAnimation fadeIn = new AlphaAnimation(0, 1.0f);AlphaAnimation fadeOut = new AlphaAnimation(1.0f, 0);fadeIn.setDuration(500);fadeOut.setDuration(500);fadeIn.setFillAfter(true);fadeOut.setFillAfter(true);Depending of the situation i apply :aLayout.startAn

  • Usama Shakeel
    android
    I am working on Wi-Engine and currently facing the issue while loading two sheets into zwoptex manager. In the code below I am loading two sheets (sheeta and sheetb), with two animations which are stored as actions in class (firstAction, secondAction). Later when I runAction on the sprite on button click, the firstAction runs fine but the secondAction uses the texture of firstAction with frames of second, which causes unexpected result. kindly if you can let me know what I am missing or doing wr

  • Chirag Raval
    android web-services ksoap2
    package com.demowold;import android.app.Activity;import android.os.Bundle; import android.widget.Button; import android.widget.EditText; import android.widget.TextView;import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.HttpTransportSE; public class DemoWold extends Activity {private EditText etUserName; private TextView lblResult; /** Called when the activity is first created. */privat

  • pawel
    android gradle android-studio facebook-android-sdk
    I followed this guide on official facebook developers site:https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android-using-android-studio/3.0/And when im trying to build first sample app im getting error:Gradle: Error while executing dx command Gradle: UNEXPECTED TOP-LEVEL EXCEPTION: Gradle: java.lang.IllegalArgumentException: already added: Landroid/support/v4/widget/CursorAdapter$1; Gradle: at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) Gradle: a

  • Creights
    android mysql sql cursor
    When I run the following query, I get unexpected results:String[] columns = new String[] { KEY_ROWID, KEY_NAME, KEY_SCORE };Cursor c = mDb.query(DATABASE_TABLE, columns, null, null, null, null, KEY_SCORE + ” DESC”, “10”);String result = “”;So, this should sort the results by the KEY_SCORE column in my table, and sort them based on descending order. When I do this, I get the following results:Mr Z – 72 Mr S – 70 Mr A – 50 Mr B – 50 Mr T – 130 Mr X – 125It therefore seems to be grouping the valu

  • Jack BeNimble
    android fonts custom-font
    I’m using a custom font for a Japanese quiz app on Android. I tried it on a friend’s phone at a cookout, and the font did not show up (it shows up on mine and others). The font is delivered with the apk. I don’t have access to the logcat, and unfortunately forgot to check the phone model, although I think it’s kind of a budget version. Has anyone had this problem this, or have any ideas what might cause it?

  • Davek804
    php android mysql foreach
    Trying to make manageable output for Android to convert $output into JSONObjects. When I use the commented out bottom line, it receives the data in Android’s log just fine, but can’t convert JSONArray to JSONObject – thus the desire for a foreach loop to return each SQL row on its own. I can’t see any syntax issues, so I don’t know what PHP is complaining about – any ideas? Also, when I use the commented out print code, it returns proper results, so I know it’s no problem accessing the db. Here’

  • genpfault
    android opengl-es android-camera textures
    i would like to mix camera preview SurfaceTexture with some overlay texture. I am using these shaders for processing:private final String vss = “attribute vec2 vPosition;\n”+ “attribute vec2 vTexCoord;\n”+ “varying vec2 texCoord;\n”+ “void main() {\n” + ” texCoord = vTexCoord;\n”+ ” gl_Position = vec4 ( vPosition.x, vPosition.y, 0.0, 1.0 );\n”+ “}”;private final String fss = “#extension GL_OES_EGL_image_external : require\n”+ “precision mediump float;\n”+ “uniform samplerExternalOES sTexture;\

  • Jorge Cevallos
    android google-play android-camera
    My app needs a Camera to work. However, it doesn’t matter if it’s a rear or frontal camera.Right now, I have this in my Manifest:<uses-feature android:name=”android.hardware.camera”/>To require a frontal Camera, I know I could also add this:<uses-feature android:name=”android.hardware.camera.front”/>But I’d like to support all devices that has EITHER camera. Is there anyway to do this?For example, I want to support Nexus 7 which has only a frontal camera. But I also want to support d

  • user1345747
    android service android-camera
    my application running services and lock camera to take pictures or videos but after some time camera will unlock automatically . tried to use alarm manager but its not working with camera lock feature. given error that fail to open camera services. Thanks in advance.

  • Slartibartfast
    android android-camera android-4.0
    I’m developing an application that works fine on all the pre ice cream sandwich android versions as well as ICS 4.0.3. However for the Galaxy Nexus with versions 4.0.1 and 4.0.2 it force closes when I call Camera.setParameters()My code snippet is given below// mCamera is my camera object. // mFrameWidth and mFrameHeight are my desired preview size Camera.Parameters params = mCamera.getParameters(); List<Camera.Size> sizes = params.getSupportedPreviewSizes(); width = mFrameWidth; height = m

  • dda
    android android-layout android-activity android-camera android-button
    I’m writing a program that has an activity which uses the phone’s camera to take a picture. There is a capture button under the camera’s SurfaceView. Now when the user presses the capture button, I want the surface view to show a preview of the picture, and under this preview there should be two buttons (accept and cancel). If the user presses cancel, then the program should go back to the camera preview to take another picture.I assume that I should define two layouts for this, but I don’t kno

  • Haozhun
    android camera android-camera
    When implementing SurfaceHolder.Callback, some online tutorials suggest (actually, I found this is what Google wrote in API demo)public void surfaceChanged(SurfaceHolder holder, int format, int width,int height) {Parameters params = camera.getParameters();params.setPreviewSize(width, height);camera.setParameters(params);camera.startPreview();}However, this is not practical. As on real device, code like this would likely raise an exception on camera.setParameter(params), as the height and width s

  • Fabian König
    exception android-camera runtimeexception
    I had problems with release the camera… I have written an application, which let the flashlight blink, when I receive a WhatsApp Message to my Phone. But when I receive very much Notification in the same Time or in near intervals, I become the Exception:11-08 21:06:50.455: E/AndroidRuntime(8726): FATAL EXCEPTION: Thread-5969 11-08 21:06:50.455: E/AndroidRuntime(8726): java.lang.RuntimeException: Method called after release() 11-08 21:06:50.455: E/AndroidRuntime(8726): at android.hardware.C

  • bpn
    android android-camera
    I wanted to make use of the zxing library to detect qrcodes in my app. But for the apps viewing purpose, i had to change the custom display orientation to portrait. Hence i had to integrate the whole zxing library into my app and addded camera.setDisplayOrientation(90) to the openDriver() method. After doing this, the program works, but I get “Runtime exceptions : Fail to connect to camera service” randomly.public void openDriver(SurfaceHolder holder) throws IOException {if (camera == null) {cam

  • Vikalp Patel
    android android-camera
    I am working with a camera and facing problem in camera orientation. I have found some answer over internet and I think this answer might be best fit for me.Can anybody give me detail instruction, how to add this answer in my camera project.?Here is my Full camera project Code.Direct code herepublic class AndroidCamera extends Activity implements SurfaceHolder.Callback{Camera camera;SurfaceView surfaceView;SurfaceHolder surfaceHolder;boolean previewing = false;LayoutInflater controlInflater = nu

  • user2624018
    android imageview android-camera
    I understand how to use the camera intent in android to take a picture and how to save it, however, I cannot view the picture I took, within the app. The intent will take me to the camera app, I’ll snap the picture, and then app crashes. Now I’ve been trying to use the ImageView function to no avail. Can someone please tell me how to use an ImageView properly? How do I write the xml file with an imageView that has no initial source image? How do I initialize a layout that’s going to display an i

Web site is in building