w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android App works on emulator, but not in real device
You're trying to parse a text field as numeric while it has non-numeric data in it. You need to catch that exception and use a reasonable default. It may just be blank, that would probably cause the same exception. double tipAmount = 0; try{ tipAmount = Double.parseDouble(tipAmountET.getText().toString()); } catch(NumberFormatException ex){} That code will catch the exception, ignore it, and use 0 as a default tip if it can't parse the value.

Categories : Android

Android Emulator vs Real Device [2013]
Genymotion rocks. According to the blog post of Cyril Mottier it is even much better then the hardware devices. http://www.cyrilmottier.com/2013/06/27/a-productive-android-development-environment/

Categories : Android

Android emulator to real device issue
You might be getting a NetworkOnMainThreadException. Sometimes there are network problems on main UI(Activity) You should use a separate thread, refer to this post

Categories : Android

Android: How to make an emulator in size of a real device?
The dimensions that you set in the emulator are in inches, which match into the corresponding real device resolution and if you select to, dimensions on your resulting monitor image. But consider that your monitor may translate that.. If you really wish to have the same dimensions in the resulting image on screen compared to the device in your hands, why not adapt the dimensions yourself until you're happy with the result? In eclipse: Window -> Android Virtual Device Manager -> Device Definitions -> New Device Create the device with the dimensions it should have (you may look in gsmarena) then run the emulator on real size making sure your monitor/video card is not scaling (extended desktop with multiple monitors). If not just tune the dimensions when creating the virtual device unti

Categories : Android

Android Intel x86 Emulator vs Real Device (Performance)
HAXM is faster then emulated ARM and if Graphics Hardware Acceleration doesn't cause any problems it is quite usable. I was able to run Nexus 10 emulator without problems until something was "fixed" in hardware acceleration and my Mac(ATI) started to freeze every time I have launched emulator. As I don't use mac nor windows anymore here some values for real device in comparison to KVM enabled Ubuntu: Emulator (4.2.2 Intel 7inch, HW enabled, host i7 running Ubuntu 64 with KVM) 07-25 11:05:40.175: I/performance:(2287): 07-25 11:05:40.285: I/performance end:(2287): Samsung Nexus 07-25 12:07:48.352: I/performance:(19139): 07-25 12:07:49.328: I/performance end:(19139) Emulator wins massively. Task was to download few files from sdd parse them into json then write to db

Categories : Android

My android app run on emulator but it's not running on real device(samsung galaxy tab 2)
I guess there is a firewall in you pc which the mysql server runs in. The emulater is in the same pc, so the firewall does not take effects. You'd better add mysql's 3306 port to your server or temporarily stop your firewall and try again.

Categories : Android

How to transmit Android real-time sensor data to computer?
You could use python sockets to recieve the data and process it. Look at: https://docs.python.org/2/howto/sockets.html for some idea of how to setup the server machine. Android has a compatible socket that you could use to send your data: Look at: http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/ for some ideas on how to use it. Edit: This will work for wifi and 3g/4g.

Categories : Android

Phonegap android project works on emulator and in some devices but not in a 2.2 android device
Thanks to @Raoul George i discovered what was the problem. When you make: var visitedList = JSON.parse(window.localStorage.getItem("visited")); in an android 4 nothing happens, but if you work with an android 2.2 you need to be sure that window.localStorage.getItem("visited") has a value.

Categories : Android

Having issue on Real Device using vector image in android. SVG-android
On newer devices that have hardware rendering turned on by default, you need to explicitly turn on software rendering. imgView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); I suspect this is probably your problem.

Categories : Android

Android : Which sensor is perfect for sensing motion in a device?
Just use the gyroscope. If anyone moves the device they will be sure to tilt it slightly. Check the gyro for any dramatic changes. http://developer.android.com/guide/topics/sensors/sensors_motion.html#sensors-motion-gyro

Categories : Android

Working with android:layout_alignStart and a real Android Device
Your problem is layout_alignStart is supported from Android 4.2 (API level 17), but Galaxy Note II is 4.1.2 (API level 16). If you go to http://developer.android.com/reference/android/R.attr.html#layout_alignStart and change the API level (in the top left corner of the page) to 16 or lower, you'll see layout_alignStart entry become grayed out.

Categories : Android

My app won't show up on android emulator and android device
You have missed to put the action in your launcher activity <action android:name="android.intent.action.MAIN" /> your correct code look like <activity android:name="com.example.trial1.Splash" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.SPLASH" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>

Categories : Android

SVG file run fine in Emulator but Gives error in Real Device?
I was not using ImageViews but placing the SVG in a Picture. I put the Picture in a custom PictureHolder class that gave the Picture x and y float values. I then used drawPicture() to put the Picture on a canvas. I couldn't get the imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); solution to work. Using the same logic I turned off hardware acceleration for the whole app in the AndroidManifest. <application android:hardwareAccelerated="false" Not ideal but it worked for me with no noticeable loss of performance.

Categories : Android

can I scale genymotion emulator to "device real size"?
Ok I get it. You're not running the Genymotion player but Virtual Box. Try to run the genymotion binary (the one where you downloaded the templates) and to launch your VMs from it directly. It brings a lot of improvements.

Categories : Android

Emulator's height and width differs from that of real device
Display metrics give the screen dimensions including the status bar and excluding the soft keys area. On 2.x devices it will give you the complete screen size but on 4.x devices(which have soft keys) it will exclude the soft key area.

Categories : Android

Android get emulator given name of device, or vice versa
get the list of PIDs for all running emulator processes parse their cmdlines, collect avd names check tcp ports opened by those processes match open ports against adb devices output

Categories : Android

About Android Logcat in real device
Going point by point: (1) The log buffers are in RAM, in the kernel. Logging is handled by a kernel driver. On recent devices, the log buffer is much larger than 64KB. They are not lost when an application exits, but will not survive a device reboot. (2) The device entries are in /dev/log, e.g. /dev/log/main for the main log, /dev/log/radio for the radio log, and /dev/log/events for the event log. The logs are stored in a format that is generally more compact than what you see in logcat, so reading them directly with something like cat may be confusing. (3) All apps write to the same log devices. Each log message is tagged with the process ID and thread ID of the log writer, so you can separate them out that way. (logcat -v threadtime will show you the pid, tid, timestamp, and tag

Categories : Android

textCapSentences works on emulator but doesn't work on real device
Have you tried setting this programmatically? EditText input = new EditText(this); input.setInputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES); Moreover, you have to be aware that "Input method editors (IMEs) do not have to honor all the settings in android:inputType. Those are suggestions or requests that you are making, not demands."(android:inputType="textCapSentences" Not Always Honored)

Categories : Android

Android: Image doesn't load on device while it does on emulator
Is your app using a layout or resolution folder-customization that is made for a different form-factor (screen size|resolution)? Also, are your views|container aligned & sized properly, or relative to something that moved or moved off-screen on the bigger monitor? Without more specific details, it's hard to help.

Categories : Android

Cocos2dx android application runs on emulator but not on device
Most probably your library is not properly generated. Goto ProjectHome->libs->armeabi->libgame.so . libgame.so file is missing. This file could be generated when you run create-android-project.bat or equivalent linux file. which creates empty android project.Try copy paste this file from there.

Categories : Android

My android app runs in eclipse emulator but doesn't run on my device
My guess is that your AVD is pre Android 3.0, and that your device is Android 3.0 and above, and that you are running into a NetworkOnMainThreadException, since you a() method is called directly from onCreate(), and does network operations. Try moving your networking code into a background thread or an AsyncTask.

Categories : Java

Android Broadcast receiver works on emulator but not on device
So I confirmed that I will have to start AppReceiver.apk at least once after install and this is a new requirement or safety thing after Android 3.1 as they want user to explicitly start an app in order to user its broadcast receiver. Since I did not wanted any GUI thing, the way I did is just wrote an activity which is not calling any view and defined the theme as android:theme="@android:style/Theme.NoDisplay" in manifest so the user won't notice after install that the app has already started and the receiver is also available. Thanks @Nitin Sethi for pointing me in the right direction. public class MyActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } } Here is how the new manif

Categories : Android

Android - Out of memory Error. When it run on real device
Add this to your Manifest <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> As for the the out of memory i used to get this when i have very large images in size, try to test it in small images ..

Categories : Android

Why does my android app works correctly on AVD by it does not on real device?
I found the answer: I was using 2.3.3 version of OS in avd. the device i have tested my app was 4. the problem solved using AsynkTask class which should be implemented in apps that they are using os versions greater than 3 when you need to get anysthing from web or connecting to database... I think this link have a good explanation: Why Ice Cream Sandwich Crashes Your App

Categories : Android

Android TCP/IP Client not work on real Device
There are many issues for your problem. 1) Your code above won't work via the phones internet connection (UMTS, GMRS) because it uses an IP from an IP pool reserved for private networks 2.) Make sure your Android Device and your server are in the same network. Routers often place WiFi/WLAN devices into a different network (subnetwork). i.e. LAN devices could get 192.168.1.0/255.255.255.128 will have ranges from 192.168.1.1 to 192.168.1.126 while WLAN gets 192.168.1.128/255.255.255 assigned and has IP addresses from 192.168.1.129 to 192.168.1.254. 3.) If you use a rooted Android devices you may be using an Android Firewall. In this case you will have to allow the App to use WiFi connection. 4.) Windows/PC Firewall. If you run a Windows or PC Firewall, make sure the Firewall is able

Categories : Java

Running Android Application on Real Device
@ecrip Dude your app needs 2.3.6 [GingerBread API 10] minimum target but you have a2.2.1(Froyo API 8) device as you said <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="18" /> In your prompt its asking for API 10 you have android 2.2.1(Froyo API 8) as you said so its not listing it here but showing in command prompt this is the problem Solution Either use newer version device or lower minSdkVersion of your application @ecrip if adb is listed on command then make sure the min sdk or your application must be less than or equal to your device api version This is very common issue with adb The most common solution if it suddenly stop showing connected device or make it offline and never become online Then Restart Eclipse or Reboot System Alter

Categories : Android

SQLite DatabaseUtils.queryNumEntries does not work on real device but works on the emulator
queryNumEntries with selection was introduced in API level 11. Your 2.3.6 device is running API level 10. You can replace it with a regular COUNT(*) selection query, for example: long mileagenum = DatabaseUtils.longForQuery(ourDatabase, "SELECT COUNT(*) FROM " + FUEL_DATABASE_TABLE + " WHERE " + KEY_MILEAGE, null);

Categories : Android

IBM Worklight 6.0 - Hybrid Android Application not working in Emulator and Device
I have found out the Solution.Initially i have added all Dojo library folder to my project www folder that makes my hybrid application hangs. What i did is i have removed all the Dojo folder from my Worklight application www folder and added only the required dojo files to my project www folder. You can check the missing library files by opening the Console view (Window > Show View > Other... > Console). From the Console view, click the Open Console button and choose Dojo Library Requests from the list. From the Dojo Library Requests console, click the View Menu (the triangle in the toolbar), and uncheck Provide Library Resources. Now Run you hybrid application to see all your missing Library Resources.

Categories : Android

Simple XML is not working from android device works fine with emulator
The statement made on this question is incorrect. Your code is working on both your device and on the emulator. The below message has nothing to do with the operation of Simple XML on Android. On Android it uses XML Pull not StAX. 07-25 11:52:17.351: I/dalvikvm(2934): Could not find method javax.xml.stream.XMLInputFactory.newInstance, referenced from method org.simpleframework.xml.stream.StreamProvider. 07-25 11:52:17.351: W/dalvikvm(2934): VFY: unable to resolve static method 6849: Ljavax/xml/stream/XMLInputFactory;.newInstance ()Ljavax/xml/stream/XMLInputFactory; Ignore this message!

Categories : Android

Android real device can't parse Apps made on Mac OS
From my experience these are some things that you could try. First thing to try is simply cleaning and rebuilding the project. project -> clean Have you enabled installation of apps from unknown sources? Have you renamed the apk file manually at all? The other reason you may be experiencing this is due to conflicting android versions. What version are you packaging the app for and does this match the version that your phone is running? You may have to export a signed version. Also try adjusting the android:minSdkVersion to match the version your running. You may be building packages for a newer version than what you are running.

Categories : Android

My JavaMail app works fine on Emulator but it is not working on my android mobile device
I find the solution Actually there is a api combatibilty problem first add in onCreate method if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } then change in manifst file <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15" /> Now its working fine on my emulator + mobile device

Categories : Android

Linearization of android sensor data (Accelerometer)
There exist various algorithms to remove noise from data and a bit of experimentation is required to find out which is best. When I last had to mess with telemetry data, I had Android put it into a CSV, which was then analysed using R. However, if you're stuck using Java, I'd have a look at commons-math and specifically, their Kalman filter. An example: // discrete time interval double dt = 0.1d; // position measurement noise (meter) double measurementNoise = 10d; // acceleration noise (meter/sec^2) double accelNoise = 0.2d; // A = [ 1 dt ] // [ 0 1 ] RealMatrix A = new Array2DRowRealMatrix(new double[][] { { 1, dt }, { 0, 1 } }); // B = [ dt^2/2 ] // [ dt ] RealMatrix B = new Array2DRowRealMatrix( new double[][]

Categories : Android

Android - streaming sensor data continuously?
This is a job for a Service to calculate the data in background. Because no UI is necessary you can use a Thread insteed of an AsyncTask to get the sensor data. There is more detail needed in general, but especially for the setup of the connection between your phone and the remote device. If you use a LAN, sockets in combination with a ByteArrayriter on the Phone and a ByteArrayReader on the device should do the job.

Categories : Java

Samsung Galaxy S II AVD (Android Virtual Device) - "emulator: ERROR: unknown skin name 'galaxy_s2'"
Have you downloaded the skin into the skins folder? (..sdk directory.../platforms/android-10/skins)

Categories : Android

Real-time wireless sensor data transfer. WiFi or Bluetooth? TCP or UDP?
Question 1: Is it worthwhile? Sorry, you have to decide that one yourself once you understand the trade-offs (including development time) Question 2: Point-to-point? Yes Question 3: Transfer at 500 Hz? 500 msg per second * 200 bytes per message(allowing protocol overhead) * 8 bits per byte = 0.8 GHz. So it's theoretically possible on a 1Ghz channel. However this assumes perfect senders & receivers, so you might not do quite that well. If you can WiFi at 10Ghz you should be fine. As a general rule UDP is faster than TCP due to less protocol overhead. Question 4: Reliability. TCP guarantees delivery in order but you have to find the message boundaries yourself. UDP is a best-effort protocol for both delivery and ordering of messages, but the packet boundaries match the mes

Categories : Android

Android logcat logging only info level on real device. Cannot get debug messages, not even unhandled exceptions
Try to follow these instructions. I have the same phone and I was experiencing the same problems until I tryied that.

Categories : Android

Android "screen redraw" developer device setting
Found it. It tried "Show GPU overdraw", but it didn't do anything. It seems I had to close the settings menu for it to become active, which I didn't do previously. I don't know in which version it was implemented, but it's there in 4.2.2

Categories : Android

PhoneGap "Hello World" launches in android emulator but no default PhoneGap "Device is ready" Screen
Ok, after a couple of weeks scratching my head around this I finally figured out what the problem was. I was using the PhoneGap CLI to build an android project against the bin directory. For some reason, when I opened Eclipse and started a new project with existing code (according to the PhoneGap documentation) somehow it produced an incomlplete java file. I discovered this by comparing a working application's java file with my one and realized the code was different. So, instead of using the CLI, I simply opened Eclipse, and started a new project from the "example" folder in the PhoneGap android directory and ran the project - it worked!

Categories : Android

How can i Write data from Android device on c2540c device?
Might this solve your problem?

Categories : Android

insert data with image on emulator android
I think you need to add images in your sqlite database and display it to users, you can find a good tutorial here http://www.androidhub4you.com/2012/09/hello-friends-today-i-am-going-to-share.html Keep in mind that it is not a good idea to keep Large images in database, you may consider using assets folder if images are exported with application or internal storage if they are captured at run time.

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.