Skip to main content

Posts

Showing posts with the label eclipse

Java Android Eclipse AVD "Unfortunately, <project name> has stopped.&rdquo;

In the eclipse/android AVD, I get "Unfortunately, has stopped" I have checked other Qs about this, but none helped. I assume it is my code that is faulty, because when I comment the code out, it runs fine. However, the android code-checker thingy shows no errors. This is my code: public TextView TextView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); setTextView(); } public void setTextView(){ TextView tv = (TextView); findViewById(R.id.textView1); tv.setText("4"); } I tried this aswell, but the same happened public TextView TextView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView tv = (TextView); findViewById(R.id.textView1); tv.setText("4"); } I'm not sure whether the structure of my code is correct either.

apk sign error in Android/Eclipse

I am facing the following error whenever I try to sign the apk with existing key store. Is it an error in the logic of my program or is it because I use an old version of Eclipse? The error is: Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/dstudios/bl/ConnectionManager; ConnectionManager is my class and it is in the bl package.

Custom component&#39;s surfaceCreated never called

I am trying to create a custom component to have the camera's preview. The ctr is called, but surfaceCreated is never being called. Also, the xml graphical designer doesn't complain about anything not working with the custom component. CameraView: import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.List; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.hardware.Camera; import android.hardware.Camera.PreviewCallback; import android.hardware.Camera.Size; import android.util.AttributeSet; import android.util.Log; import android.view.Display; import android.view.Surface; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; public class CameraView extends SurfaceView implements SurfaceHolder.Callback { private static