Search Results

Search found 1238 results on 50 pages for 'emulator'.

Page 14/50 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Error when starting a tab activity in Android?

    - by ATDeveloper
    I followed the directions verbatim in this Android tutorial, copying/pasting the code from the site to my app. http://developer.android.com/resources/tutorials/views/hello-tabwidget.html However, when I try to run in the Android emulator, I get the error: "The application Hello Tab Widget has stopped unexpectedly. Please try again." I tried debugging by introducing a breakpoint in the first line of the onCreate method, but the error occurs before the breakpoint is even hit. Any idea of what is going wrong, or any other way I can debug this issue? I am using Eclipse.

    Read the article

  • Android: How to maintain backwards-compatibility?

    - by Peterdk
    According to the instructions found here, to make your app state which screen sizes you can support, you'll need to compile your app against Android 1.6. Using the minSdkVersion and targetSdkVersion this should run also on Android 1.5: <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="4"/> However, when I try to launch my app from Eclipse to run in a emulated 1.5, I get the following error: Failed to find an AVD compatible with target 'Android 1.6'. Is this an error of the eclipse tools/emulator? Or how do I get it to also target 1.5 correctly while giving me the option to specify the supported screens?

    Read the article

  • Passing Activity to non-activity object properly

    - by rayman
    In my app ive got a non-activity object which it's role is being a manager class. many times i need to pass "source activity" to methods as parameter to that manager class in order to make some operations on that activity. for exaple let's assume we have MyActivity which gotta do some toast. so i have this manager class called MyManager, and i have this method in it raiseToast(Activity sourceActivity) { Toast.makeText(sourceActivity, demo, Toast.LENGTH_LONG).show(); } and from Myactivity class we calling that method this way: MyManager manager=new MyManager(); manager.raitetoast(MyActivity.this); it works fine. what I'm asking here, is this a proper way to pass an Activity as parameter to a non-activity object? I'm having a memory leaks on real device(not the emulator), I wonder if this could also causing any reason for that? Thanks Idan.

    Read the article

  • Base64 Android encode to PHP decode make error

    - by studio lambda
    I'm a french guy, so, I'm sorry for my english... I'm developing an Android App which communicate with a PHP REST service. So, when I try to encode an image file into Base64 like this : InputStream fileInputStream = context.getContentResolver().openInputStream(uri); BufferedInputStream in = new BufferedInputStream(fileInputStream); StringWriter out = new StringWriter(); int b; while ((b = in.read()) != -1) out.write(b); out.flush(); out.close(); in.close(); String encoded = new String(android.util.Base64.encode(out.toString() .getBytes(), android.util.Base64.DEFAULT)); On server side, I make : $data=base64_decode(chunk_split($base64BinaryData)); The result is that my image file is corrupted! INFO : the image is made by an Intent to android.provider.MediaStore.ACTION_IMAGE_CAPTURE Activity in Emulator mode (avd 5554) I've already read lots of discussions about similar problem but nothing fix my bug. thanks for help Regards,

    Read the article

  • How to run Android instrumentation tests from the command line (in Kubuntu)?

    - by KK
    We are able to run instrumentation tests of Android from the command line on Windows by launching: adb shell am instrument -w <package.test>/android.test.InstrumentationTestRunner This gives us good results. Using the same architecture, we are unable to run the same in Kubuntu. We have the same setup in Kubuntu. Can someone let us know, if there are packages with same name.. Then what package will the adb shell point? How will the emulator connect with adb shell from cmd line? DO we need to do any changes to do so in Kubuntu ?

    Read the article

  • Can I use android.os.* libraries in a standalone project?

    - by medicdave
    I'm trying to develop an external library (not sure if that's the right term) to provide prepackaged functionality in Android projects. Working in Eclipse, I've added the appropriate android.jar file to the build path, and everything is happy both while editing and upon compilation. However, when I use Android's Handler and Message classes (android.os.Handler, android.os.Message) for inter-thread communication, I get exceptions unless I'm running within an Android app, on the emulator or a device. I can no longer test my library in a "standalone" way without having to go through a running Android target. Is there any way for me to include these two Android classes and still be able to test my library standalone? Do I need to have the Android source available? Or would it require some sort of conditional compilation hand-waving?

    Read the article

  • how can i get proper Uri of a particular contact in android 2.1

    - by Rishabh
    I have written an application and added 2 contacts on emulator, but i am not able to update their names on android 2.1, code is working on android 1.6 platform with the following code. ContentValues contactValues = new ContentValues(); contactValues.put(Contacts.People.NAME, firstName+" "+lastName); getContentResolver().update(UpdateContactUri, contactValues, null, null); In android 1.6 i am getting Uri for those two contacts are "content:// contacts/people/1" and "content://contacts/people/2". but in 2.1 I am getting these values are "content://contacts/people/8" and "content://contacts/people/9" and while updating its giving "java.IllegalArgumentException, Empty values" exception. When i tried to put a static Uri like "content://contacts/people/1", code was debugged sucessfully but contact was not updated. How can i resolve it, why i am not getting uri like 1.6 platform ? Thanks in advance...

    Read the article

  • Android Virtual Device freezing during its loading

    - by maarlin
    Hello, I've downloaded Eclipse Classic 3.5 Galileo, the last version of Android SDK, downloaded and installed Eclipse Android 1.6 platform. I've created first (and the only) AVD with Android 1.6 and the default skin. The log may show more: I've filtered only neccessary messages (warnings, errors). -http://www.clipboard.cz/63c As you can see, my new AVD has started in 16:17 and it was still loading in 17:35... The emulator looks like this: http://img130.imageshack.us/img130/3540/androidloading.png PS: The restrictions about number of links for new accounts are REALLY annoying...

    Read the article

  • debugging android app to the phone

    - by tipu
    I've gone through this page: http://developer.android.com/guide/developing/device.html, My manifest has <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true"> My phone has Menu - Settings - Applications - Development - USB Debugging checked I have gone to the control panel on my Windows XP 64 bit and installed the USB drivers given to me by the SDK installer at: android-sdk_r05-windows\android-sdk-windows\usb_driver So my computer does recognize the android device. However.. when I run an app on Eclipse, it still insists on opening it up in an emulator rather than my phone. How can I fix that?

    Read the article

  • Jelly bean not calling onPrepareOptionsMenu() when opening the menu for the first time

    - by syloc
    I'm overriding onPrepareOptionsMenu to hide and show menu items. When testing it with the API level 16 emulator; onPrepareOptionsMenu is not called when opening the menu for the first time. But when i reopen the menu it works. The problem is only with the first usage. You can simple test it with this; @Override public void onPrepareOptionsMenu(Menu menu) { Toast.makeText(this.getActivity(), "pre", Toast.LENGTH_SHORT).show(); super.onPrepareOptionsMenu(menu); } Any ideas?

    Read the article

  • Android::Confused about image sizes in a website

    - by Legend
    I was testing my website inside the Android emulator with the Droid Skin (240 dpi). I have the following css: #container { position: relative; width: 854px; height: 480px; background: #000; margin: auto; } #container li { position: relative; list-style: none; width: 201px; height: 110px; padding-left: 10px; padding-top:10px; padding-bottom:10px; overflow: hidden; float: left; z-index: 2; } The display is not what I expected obviously because I am defining everything in px (when I should have been using dip but css does not allow dip). How can I convert my px to something that is suitable for Android? Any suggestions?

    Read the article

  • Deeper function profiling/emulation

    - by Syntax_Error
    Hello everyone Merry Christmas I need an advice I have the following code: int main() { int k=5000000; int p; int sum=0; for (p=0;p<k;p++) { sum+=p; } return 0; } When I assemble it I get main: pushl %ebp movl %esp, %ebp subl $16, %esp movl $5000000, -4(%ebp) movl $0, -12(%ebp) movl $0, -8(%ebp) jmp .L2 .L3: movl -8(%ebp), %eax addl %eax, -12(%ebp) addl $1, -8(%ebp) .L2: movl -8(%ebp), %eax cmpl -4(%ebp), %eax jl .L3 movl $0, %eax leave ret If I run it through gprof I get that main executed the most, which is quite obvious! Yet I want to go a step further and be able to know if L2, or L3 executed the most. here it is obvious that L3 executed the most. yet is there some kind of profiler, emulator that can give me that data for an entire code?

    Read the article

  • How to implement Google Maps new version of API v2

    - by bapatla
    Hi every one I came to know that google maps has deprecated its previous version API v1 and introduced a new version of google maps API v2. I tried out one example by following some links in google any how i am pretty sure that i got the api key correctly by providing the exact hash key code and managed to get the correct api key. Now i managed to write some code as well but when i tried to execute the code i am getting the errors please help me to solve this here is my code and i even tried the sample codes provided by google play services an i got the same problem this is the sample that i have done by referring some links in google main activity package com.example.apv; import com.google.android.gms.maps.CameraUpdateFactory; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.MarkerOptions; import android.os.Bundle; import android.app.Activity; import android.app.FragmentManager; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); FragmentManager fragmentManager = getFragmentManager(); MapFragment mapFragment = (MapFragment) fragmentManager.findFragmentById(R.id.map); GoogleMap googleMap = mapFragment.getMap(); LatLng sfLatLng = new LatLng(37.7750, -122.4183); googleMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); googleMap.addMarker(new MarkerOptions() .position(sfLatLng) .title("San Francisco") .snippet("Population: 776733") .icon(BitmapDescriptorFactory.defaultMarker( BitmapDescriptorFactory.HUE_AZURE))); googleMap.getUiSettings().setCompassEnabled(true); googleMap.getUiSettings().setZoomControlsEnabled(true); googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(sfLatLng, 10)); } } main.xml <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.MapFragment"/> and finally my manifest file <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.apv" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17"/> <permission android:name="com.codebybrian.mapsample.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> <!--Required permissions--> permission oid:name="com.codebybrian.mapsample.permission.MAPS_RECEIVE"/> <!--Used by the API to download map tiles from Google Maps servers: --> <uses-permission android:name="android.permission.INTERNET"/> <!--Allows the API to access Google web-based services: --> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!--Optional permissions--> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <!--Version 2 of the Google Maps Android API requires OpenGL ES version 2 --> <uses-feature android:glEsVersion="0x00020000" android:required="true"/> application android:label="@string/app_name" android:icon="@drawable/ic_launcher"> <activity android:name=".MyMapActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AZzaSSsBmhi4dXoKSylGGmjkQ5Jev9UdAJBjk"/> </application> </manifest> i run my application in emulator of version 4.2 and api level of 17 i got following error 12-17 10:06:52.590: E/Trace(826): error opening trace file: No such file or directory (2) 12-17 10:06:52.590: W/Trace(826): Unexpected value from nativeGetEnabledTags: 0 12-17 10:06:52.590: W/Trace(826): Unexpected value from nativeGetEnabledTags: 0 12-17 10:06:52.590: W/Trace(826): Unexpected value from nativeGetEnabledTags: 0 12-17 10:06:52.680: I/ActivityThread(826): Pub com.google.android.gms.plus;com.google.android.gms.plus.action: com.google.android.gms.plus.provider.PlusProvider 12-17 10:06:52.740: W/Trace(826): Unexpected value from nativeGetEnabledTags: 0 12-17 10:06:52.740: W/Trace(826): Unexpected value from nativeGetEnabledTags: 0 12-17 10:06:52.760: W/Trace(826): Unexpected value from nativeGetEnabledTags: 0 later i came to know that these version cant execute in emulator so i tried executing it with two devices one is Sony xperia u of android version 2.3.7 and Samsung galaxy tab of android version 4.1.1 and these are my outputs 12-17 14:37:02.468: D/AndroidRuntime(7636): Shutting down VM 12-17 14:37:02.468: W/dalvikvm(7636): threadid=1: thread exiting with uncaught exception (group=0x41f672a0) 12-17 14:37:02.476: E/AndroidRuntime(7636): FATAL EXCEPTION: main 12-17 14:37:02.476: E/AndroidRuntime(7636): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.apv/com.example.apv.MyMapActivity}: java.lang.ClassNotFoundException: com.example.apv.MyMapActivity 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2021) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.ActivityThread.access$600(ActivityThread.java:140) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.os.Handler.dispatchMessage(Handler.java:99) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.os.Looper.loop(Looper.java:137) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.ActivityThread.main(ActivityThread.java:4895) 12-17 14:37:02.476: E/AndroidRuntime(7636): at java.lang.reflect.Method.invokeNative(Native Method) 12-17 14:37:02.476: E/AndroidRuntime(7636): at java.lang.reflect.Method.invoke(Method.java:511) 12-17 14:37:02.476: E/AndroidRuntime(7636): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller .run(ZygoteInit.java:994) 12-17 14:37:02.476: E/AndroidRuntime(7636): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761) 12-17 14:37:02.476: E/AndroidRuntime(7636): at dalvik.system.NativeStart.main(Native Method) 12-17 14:37:02.476: E/AndroidRuntime(7636): Caused by: java.lang.ClassNotFoundException: com.example.apv.MyMapActivity 12-17 14:37:02.476: E/AndroidRuntime(7636): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 12-17 14:37:02.476: E/AndroidRuntime(7636): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 12-17 14:37:02.476: E/AndroidRuntime(7636): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.Instrumentation.newActivity(Instrumentation.java:1068) 12-17 14:37:02.476: E/AndroidRuntime(7636): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2012) 12-17 14:37:02.476: E/AndroidRuntime(7636): ... 11 more could any one please suggest me to how to get this done and give me some links of new version API v2 tutorials of google maps and some examples links please help me

    Read the article

  • "Hello, WebView" tutorial opens the requested address in Android browser and not in my webview

    - by VitalyB
    Hi everyone, I am using Android emulator with AVD of Android 2.1 and I have the following problem: Trying to load a URL in a WebView using webView.loadUrl causes it to open in the browser instead. Note: I am talking about the initial opening, not the issue in which links from the WebView open in a browser, though, perhaps it is somehow connected. I've tried several things: I've removed <uses-permission android:name="android.permission.INTERNET" /> from the manifest. That actually made it work correctly, i.e, load the html into the webview. However, as one would expect, the only thing it loaded is "unable to connect the internet" error page. I've tried downloading a real sample project ("Hello Android" book source files, project - BrowserView). However, it didn't work just the same. I've created a new project and followed the directions at Google's official tutorial of using WebView and got the same result. I haven't find anyone else complaining about it. Why does it happen? Thanks, Vitaly

    Read the article

  • OrientationEventListener not working properly

    - by nixau
    Hi all, I need to handle orientation changes in my Android application. For this purpose I decided to use OrientationEventListener convenience class. But his callback method is given somewhat strange behavior. My application starts in the portrait mode and then eventually switches to the lanscape one. I have some custom code executing in the callback onOrientationChanged method that provides some additional UI handling logic - it has a few calls to findViewById. What is strange is that when switching back from landscape to portrait mode onOrientationChanged callback is called twice, and what's even worse - the second call is dealing with bad Context - findViewById method starts returning null. These calls are made right from the MainThread @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); listener = new OrientationListener(); } @Override protected void onResume() { super.onResume(); // enabling listening listener.enable(); } @Override protected void onPause() { super.onPause(); // disabling listening listener.disable(); } I've replicated the same behavior with a dummy Activity without any logic except for one that deals with orientation hadling. I initiate orientation switch from the Android 2.2 emulator by pressing Ctrl+F11 What could be wrong? Upd: Inner class that implements OrientationEventListener private class OrientationListener extends OrientationEventListener { public OrientationL() { super(getBaseContext()); } @Override public void onOrientationChanged(int orientation) { toString(); } } }

    Read the article

  • Why is my Android app camera preview running out of memory on my AVD?

    - by Bryan
    I have yet to try this on an actual device, but expect similar results. Anyway, long story short, whenever I run my app on the emulator, it crashes due to an out of memory exception. My code really is essentially the same as the camera preview API demo from google, which runs perfectly fine. The only file in the app (that I created/use) is as below- package berbst.musicReader; import java.io.IOException; import android.app.Activity; import android.content.Context; import android.hardware.Camera; import android.os.Bundle; import android.view.SurfaceHolder; import android.view.SurfaceView; /********************************* * Music Reader v.0001 * Still VERY under construction. * @author Bryan * *********************************/ public class MusicReader extends Activity { private MainScreen main; @Override //Begin activity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); main = new MainScreen(this); setContentView(main); } class MainScreen extends SurfaceView implements SurfaceHolder.Callback { SurfaceHolder sHolder; Camera cam; MainScreen(Context context) { super(context); //Set up SurfaceHolder sHolder = getHolder(); sHolder.addCallback(this); sHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS); } public void surfaceCreated(SurfaceHolder holder) { // Open the camera and start viewing cam = Camera.open(); try { cam.setPreviewDisplay(holder); } catch (IOException exception) { cam.release(); cam = null; } } public void surfaceDestroyed(SurfaceHolder holder) { // Kill all our crap with the surface cam.stopPreview(); cam.release(); cam = null; } public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) { // Modify parameters to match size. Camera.Parameters params = cam.getParameters(); params.setPreviewSize(w, h); cam.setParameters(params); cam.startPreview(); } } }

    Read the article

  • error with "pmem.c" compiling linux source code for android

    - by Preetam
    I am compiling linux source code for android emulator. When i execute make command(for building and cross-compiling the linux source) i get the following error "pmem.c" file. root@ubuntu:~/common# make CHK include/linux/version.h CHK include/linux/utsrelease.h SYMLINK include/asm - include/asm-x86 CALL scripts/checksyscalls.sh CHK include/linux/compile.h CC drivers/misc/pmem.o drivers/misc/pmem.c:441: error: conflicting types for ‘phys_mem_access_prot’ /home/preetam/common/arch/x86/include/asm/pgtable.h:383: note: previous declaration of ‘phys_mem_access_prot’ was here drivers/misc/pmem.c: In function ‘flush_pmem_file’: drivers/misc/pmem.c:805: error: implicit declaration of function ‘dmac_flush_range’ drivers/misc/pmem.c: In function ‘pmem_setup’: drivers/misc/pmem.c:1265: error: implicit declaration of function ‘ioremap_cached’ drivers/misc/pmem.c:1266: warning: assignment makes pointer from integer without a cast make[2]: * [drivers/misc/pmem.o] Error 1 make[1]: [drivers/misc] Error 2 make: ** [drivers] Error 2 root@ubuntu:~/common# how to resolve this error. It seems that there may some problems in the "pmem.c" file and i'll have to choose different git repository. but that would be a very complex thing, as now i have already done most of the things till here. I might have to see correct version of this file. please someone tell what should i do? how to solve this errors. please help..thankyou!

    Read the article

  • Problems when handling orientation changes

    - by nixau
    Hi all, I need to handle orientation changes in my Android application. For this purpose I decided to use OrientationEventListener convenience class. But his callback method is given somewhat strange behavior. My application starts in the portrait mode and then eventually switches to the lanscape one. I have some custom code executing in the callback onOrientationChanged method that provides some additional UI handling logic - it has a few calls to findViewById. What is strange is that when switching back from landscape to portrait mode onOrientationChanged callback is called twice, and what's even worse - the second call is dealing with bad Context - findViewById method starts returning null. These calls are made right from the MainThread @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); listener = new OrientationListener(); } @Override protected void onResume() { super.onResume(); // enabling listening listener.enable(); } @Override protected void onPause() { super.onPause(); // disabling listening listener.disable(); } I've replicated the same behavior with a dummy Activity without any logic except for one that deals with orientation hadling. I initiate orientation switch from the Android 2.2 emulator by pressing Ctrl+F11 What could be wrong? Upd: Inner class that implements OrientationEventListener private class OrientationListener extends OrientationEventListener { public OrientationL() { super(getBaseContext()); } @Override public void onOrientationChanged(int orientation) { toString(); } } }

    Read the article

  • Force close on clicking on radio button

    - by neos300
    Whenever I try to press a radio button on my emulator, it just force closes! public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button b = (Button)this.findViewById(R.id.btn_confirm); b.setOnClickListener(this); RadioButton radio_ctf = (RadioButton) findViewById(R.id.radio_ctf); RadioButton radio_ftc = (RadioButton) findViewById(R.id.radio_ftc); radio_ctf.setOnClickListener(this); radio_ftc.setOnClickListener(this); } @Override public void onClick(View v) { TextView tv = (TextView)this.findViewById(R.id.tv_result); EditText et = (EditText)this.findViewById(R.id.et_name); RadioButton radio_ctf = (RadioButton) findViewById(R.id.radio_ctf); RadioButton radio_ftc = (RadioButton) findViewById(R.id.radio_ftc); double y = 0; int x = Integer.parseInt(et.getText().toString()); if(radio_ctf.isChecked()) { y = ((double)x * 1.8) + 32; } if(radio_ftc.isChecked()) { y = ((double)x - 32) * 0.555; } String text = "Result:" + y; tv.setText(text);

    Read the article

  • Why is the operation address incremented by two?

    - by Gavin Jones
    I am looking at a Javascript emulator of a NES to try and understand how it works. On this line: addr = this.load(opaddr+2); The opcode is incremented by two. However, the documentation (see appendix E) I'm reading says: Zero page addressing uses a single operand which serves as a pointer to an address in zero page ($0000-$00FF) where the data to be operated on can be found. By using zero page addressing, only one byte is needed for the operand, so the instruction is shorter and, therefore, faster to execute than with addressing modes which take two operands. An example of a zero page instruction is AND $12. So if the operand's argument is only one byte, shouldn't it appear directly after it, and be + 1 instead of + 2? Why +2? This is how I think it works, which may be incorrect. Suppose our memory looks like: ------------------------- | 0 | 1 | 2 | 3 | 4 | 5 | <- index ------------------------- | a | b | c | d | e | f | <- memory ------------------------- ^ \ PC and our PC is 0, pointing to a. For this cycle, we say that the opcode: var pc= 0; //for example's sake var opcode= memory[pc]; //a So shouldn't the first operand be the next slot, i.e. b? var first_operand = memory[pc + 1]; //b

    Read the article

  • Android Application Crashel

    - by deewangan
    hello everyone, i am trying to run an application on an android emulator, but it crashes. i am following a howto i don't know what to do, it just crashes. other applications are running fine, can anyone tell me what i am doing wrong.here is the code: public class Finder extends Activity { /** Called when the activity is first created. */ private LocationManager myLocationManager; private LocationListener myLocationListener; private TextView myLatitude, myLongitude; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); myLatitude = (TextView)findViewById(R.id.Latitude); myLongitude = (TextView)findViewById(R.id.Longitude); myLocationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); myLocationListener = new MyLocationListener(); myLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,0,0,myLocationListener); myLatitude.setText(String.valueOf( myLocationManager.getLastKnownLocation( LocationManager.GPS_PROVIDER).getLatitude())); myLongitude.setText(String.valueOf( myLocationManager.getLastKnownLocation( LocationManager.GPS_PROVIDER).getLongitude())); } private class MyLocationListener implements LocationListener{ public void onLocationChanged(Location argLocation) { // TODO Auto-generated method stub myLatitude.setText(String.valueOf( argLocation.getLatitude())); myLongitude.setText(String.valueOf( argLocation.getLongitude())); } public void onProviderDisabled(String provider) { // TODO Auto-generated method stub } public void onProviderEnabled(String provider) { // TODO Auto-generated method stub } public void onStatusChanged(String provider, int status, Bundle extras) { // TODO Auto-generated method stub } }; } i looked in the logcat after running the application, it seems that the following lines are cause of the problem but i don't understand it:( 01-18 22:12:46.017: WARN/dalvikvm(1091): threadid=3: thread exiting with uncaught exception (group=0x4001aa28) 01-18 22:12:46.017: ERROR/AndroidRuntime(1091): Uncaught handler: thread main exiting due to uncaught exception 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): java.lang.RuntimeException: Unable to start activity ComponentInfo{pro.googleLocation/pro.googleLocation.Finder}: java.lang.NullPointerException 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.os.Handler.dispatchMessage(Handler.java:99) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.os.Looper.loop(Looper.java:123) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at java.lang.reflect.Method.invokeNative(Native Method) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at java.lang.reflect.Method.invoke(Method.java:521) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at dalvik.system.NativeStart.main(Native Method) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): Caused by: java.lang.NullPointerException 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at pro.googleLocation.Finder.onCreate(Finder.java:28) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 01-18 22:12:46.037: ERROR/AndroidRuntime(1091): ... 11 more

    Read the article

  • Android: simple webview code. ERR: Unable to start Activity

    - by vnshetty
    I have following code: public class reader extends Activity { WebView mWebView; String mFilename; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mWebView = (WebView) findViewById(R.id.webView1); setContentView(R.layout.webview); mWebView.loadUrl("http://www.google.com"); } } When I run this, the emulator shows "Sorry:.. mireader Stopped unexpectedly" error.. Why ? DDMS log dump: 03-02 12:25:26.430: INFO/AndroidRuntime(2837): NOTE: attach of thread 'Binder Thread #3' failed 03-02 12:25:26.729: INFO/ActivityManager(72): Start proc com.mireader for activity com.mireader/.reader: pid=2846 uid=10032 gids={3003, 1015} 03-02 12:25:29.621: DEBUG/AndroidRuntime(2846): Shutting down VM 03-02 12:25:29.621: WARN/dalvikvm(2846): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): FATAL EXCEPTION: main 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mireader/com.mireader.reader}: java.lang.NullPointerException 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.os.Handler.dispatchMessage(Handler.java:99) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.os.Looper.loop(Looper.java:123) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.ActivityThread.main(ActivityThread.java:4627) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at java.lang.reflect.Method.invokeNative(Native Method) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at java.lang.reflect.Method.invoke(Method.java:521) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at dalvik.system.NativeStart.main(Native Method) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): Caused by: java.lang.NullPointerException 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at com.mireader.reader.onCreate(reader.java:36) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 03-02 12:25:29.660: ERROR/AndroidRuntime(2846): ... 11 more 03-02 12:25:29.699: WARN/ActivityManager(72): Force finishing activity com.mireader/.reader 03-02 12:25:30.550: WARN/ActivityManager(72): Activity pause timeout for HistoryRecord{44f98868 com.mireader/.reader} 03-02 12:25:33.230: DEBUG/dalvikvm(200): GC_EXPLICIT freed 164 objects / 11312 bytes in 7516ms 03-02 12:25:35.020: INFO/Process(2846): Sending signal. PID: 2846 SIG: 9 03-02 12:25:35.080: WARN/InputManagerService(72): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@44fc35e0 03-02 12:25:35.809: INFO/ActivityManager(72): Process com.mireader (pid 2846) has died. 03-02 12:25:37.960: DEBUG/dalvikvm(320): GC_EXPLICIT freed 83 objects / 4000 bytes in 78ms 03-02 12:25:42.674: WARN/ActivityManager(72): Activity destroy timeout for HistoryRecord{44f98868 com.mireader/.reader}

    Read the article

  • Why isn't my assets folder being installed on emulator?

    - by Brad Hein
    Where are my assets being installed to? I utilize an assets folder in my new app. I have two files in the folder. When I install my app on the emulator, I cannot access my assets, and furthermore I cannot see them on the emulator filesystem. Extracted my apk and confirmed the assets folder exists: $ ls -ltr assets/ total 16 -rw-rw-r--. 1 brad brad 1050 2010-05-20 00:33 schema-DashDB.sql -rw-rw-r--. 1 brad brad 9216 2010-05-20 00:33 dash.db On the emulator, no assets folder: # pwd /data/data/com.gtosoft.dash # ls -l drwxr-xr-x system system 2010-05-20 00:46 lib # I just want to package a pre-built database with my app and then open it to obtain data when needed. Just tried it on my Moto Droid, unable to access/open the DB, just like the emulator: DBFile=/data/data/com.gtosoft.dash/assets/dash.db Building the DB on the fly from a schema file is out of the question because its such a slow process (about 5-10 statements per second is all I get for throughput).

    Read the article

  • How to prepare KML file for Android Emulator Control?

    - by AndroiDBeginner
    I am trying to test my application with location information. You know the Emulator Control has an ability to load from KML file. (Eclipse - DDMS - Emulator Control - Location Controls - KML - Load KML...) I've prepared KML file using Google earth application with its "Add path". Then saved it by .kml extension and load it on the Eclipse. Eclipse didn't load this KML file. How to prepare KML file for Android Emulator Control?

    Read the article

  • Is there an x86 or x64 emulator that passes system calls back to the Windows API?

    - by Chris Lomont
    I want to emulate windows programs (not VM, true emulation) under windows. This would require the emulator to make calls back to the system APIs, but the program itself would be emulated. The reason is I want to change the opcode formats for research purposes. The process should be: Take existing program. Disassemble and then reassemble with my new opcode formats. Put the new format into the PE with a stub calling the emulator and passing the new code. The emulator would have to pass system calls from the emulated side back to windows API calls. I can do all these steps, except I need an open source emulator with the ability to pass the API calls out. I could try Bochs or QEMU, but I think I'd have to add in the system calls, which I could do if needed. I wonder if there is already something closer to what I need. I know I would have to change the instruction decoding in the emulator to match my new formats, but that is a given. Thanks.

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >