w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android application can't run on Galaxy S4 but can run at Galaxy Ace 2
If AndroidXMLParsingActivity is the activity to be opened after the MainActivity, why don't you use this code to open the activity. startActivity(new Intent(this, AndroidXMLParsingActivity.class)); in place of your code: String packageName = AndroidXMLParsingActivity.class .getPackage().getName(); String packageAndClassName = AndroidXMLParsingActivity.class .getName(); Intent intent = new Intent().setClassName(packageName, packageAndClassName); startActivity(intent);

Categories : Java

Android MediaPlayer prepareAsync is failing on Galaxy SIII with Android 4.1.2
06-19 21:57:32.295: V/MediaPlayerService(1919): [238] notify (0x41f61fa8, 100, 1, -1004) I came across this exact scenario today, and my problem was that I was behind a firewall that did not allow one traffic on one of the streaming ports.

Categories : Android

setInterval in Android Default Browser on Galaxy S4 (Android 4.2.2)
Turns out it wasn't actually setInterval's fault at all. Weirdly enough eval.call(window, 'some js'); seems to stop all intervals from working on this particular browser. Really don't understand how. This is the only phone we've seen it on - it doesn't happen on the stock browser on the S3 (Android 4.2.1). P.S. The only reason we're doing eval.call is to allow make banner ads which use document.write to add scripts in a one page dynamic loading app. I'd much rather it wasn't there.

Categories : Javascript

Android monitor won't recognize my Android (Galaxy S2) on Windows 8
You should probably install Samsung Kies since you are using a Samsung device. This will install all Samsung related drivers which should enable your adb to recognize the device.

Categories : Android

Android Galaxy S4 camera bug
The contract for Camera.AutoFocusCallback.onAutoFocus does not assume that it will be triggered only once after a call to camera.autoFocus(). So, I would simply add a boolean variable, e.g. camera.autoFocus(new Camera.AutoFocusCallback() { boolean once = true; @Override public void onAutoFocus(boolean success, Camera camera) { if (once && success) { camera.takePicture(shutterCallback, null, PreviewCallback.this); once = false; } } }); BTW, you should check the first parameter value - if autofocus failed, you probably don't want to take the picture in the first place.

Categories : Android

Android App not starting - Only on Galaxy S4
First thing is to try and get users to send error reports when a crash happens, but lets face it, most people won't do that. So I would suggest looking into an automatic crash reporting system such as Crittercism.

Categories : Android

Android Galaxy S4 scaling images
The quick and dirty answer is: yes, the S4 (and all Android devices) do the auto-scaling of images as necessary based on their display pixel density and the density of the input image. I believe that the S4 is classified as an "xxhdpi" device which makes it 3x the standard "mdpi" device. A much more thorough discussion that explains all the details that go into these calculations and why they matter can be seen at http://stackoverflow.com/a/2639150/3032.

Categories : Android

Android NullPointerException only in Galaxy SII/III phones
If MediaPlayer.create fails, then mp can be null. You'd then call mp.prepare on it, which would crash. In the case of create failing you want to return from this function and not continue to try to play the song.

Categories : Android

Testing android app on Samsung Galaxy Tab
Make sure the device is connected and try from the command line: adb devices. If it does not appear then the device is not seen, perhaps you should install the drivers. (adb is located in ~/android sdk/platform tools)

Categories : Android

Android Studio 0.2.5 Does not see Galaxy S4 as device
I have a Galaxy S3 and initially I did not know what to do when I was in the same position as you are. The Android page on making your device recognizable via USB is slightly misleading. So what is the way out ? Well, download and install Samsung Kies and let it do its work. It will install all the necessary drivers to make your device recognizable. Happy coding.

Categories : Android

Galaxy S4 not recognized by Android SDK on Windows
According to the system requirements listed on the Android SDK download page on Android Developers, only Windows XP and above is compatible with the full Android SDK, and Windows Server 2003 appears to be based on Windows 98. There may also be compatibility issues with KIES too, as Samsung's website states that KIES is only compatible with XP and above. Therefore it is probably your OS that is the problem. If you have another Android phone, try connecting that to your PC and installing the drivers. If it is not recognized, it is almost certainly your OS.

Categories : Android

run-as Package 'a.b.c' is unknown - Galaxy S4 Jellybean or Android 4.3
Found success by adding this to the activity: private void startGdbServer() { try { new ProcessBuilder() .command(getFilesDir().getParent() + "/lib/gdbserver", "tcp:5039", "--attach" ,"" + android.os.Process.myPid()) .redirectErrorStream(true) .start(); } catch (IOException e) { Log.e(TAG, "IOException failed to start gdbserver"); } } Then I wrapped startGdbServer in an Android service and updating the ndk-gdb script to start the server instead of the run-as command. Here's the manifest addition: <service android:enabled="true" android:name="com.apportable.activity.GdbServerService" android:label="@string/app_name" android:icon="@drawable/icon"> <intent-filter > <action android:name="apportable.Foun

Categories : Android

adb not detecting galaxy ace after flashing android 4.3 cyanogenmod
Try to switch the device into PTP mode (under Settings -> Storage -> USB Computer Connection and manually select the connection mode...) and connect to computer. Let it install, switch back to USB mode and plug in again.

Categories : Android

How get per core cpu usage on Android / Galaxy SIII
It should include the different cores (showing Nexus 7): $ adb shell cat /proc/cpuinfo Processor : ARMv7 Processor rev 9 (v7l) processor : 0 BogoMIPS : 1993.93 processor : 1 BogoMIPS : 1993.93 processor : 2 BogoMIPS : 1993.93 processor : 3 BogoMIPS : 1993.93 and stat: $ adb shell cat /proc/stat cpu 1623573 112801 907626 32541158 125987 68 5952 0 0 0 cpu0 804181 45734 569092 7373416 43990 49 4990 0 0 0 cpu1 332438 26759 142892 8311267 31256 9 574 0 0 0 cpu2 332889 25551 130711 8319093 30900 7 218 0 0 0 cpu3 154065 14757 64931 8537382 19841 3 170 0 0 0

Categories : Android

Array writes all zeros with Android 4.1.2 on HTC One/Galaxy S4
I cannot find any details on exactly what sigbuffer is, except that it seems to be more an output than an input channel. Your problem is perhaps that the HTC One/S4 is too fast, and sigbuffer is a DMA interface, so the data gets overwritten before it is sent to the audio subsystem. Looking at [the API here](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/audio/AudioDevice.html#writeSamples(short[], int, int)), perhaps you would be better doing: public void loadsine(){ short values[44100]; for (int j=0; j<44100; j++){ double val = Math.sin(twopi*j/44100); values[j] = (short) (val*sinemax); } androidAudioDevice.writeSamples(values, 0, 44100); }

Categories : Android

Memfetch with Android Samsung Galaxy Nexus
That is because of stupidity of Windows Command Line, that make some null characters as input to linux commands. the solution is, if you don't use other inputs "samwS" comment this lines, while ((opt=getopt(argc,(void*)argv, "+samwS:h"))!=EOF) switch(opt) { case 's': waitsig=1; break; case 'a': skipmap=1; break; case 'w': textout=1; break; case 'm': avoid_mmap=1; break; case 'S': if (sscanf(optarg,"%x",&onlyseg)!=1) fatal("Incorrect -S syntax (hex address expected). "); break; default: usage(argv[0]); } it you use them just comment default: usage(argv[0]);

Categories : Android

Android webview display gets messy on Galaxy S4
After a lot of struggling to find a decent solution, the final fix was to REMOVE the following from css: -webkit-transform: translate3d(0,0,0) The weird thing is that in this SO topic, it was advised to ADD this attribute to fix a similar problem... I don't exactly know what this line does, but if you meet a similar issue, I strongly advise you to look your CSS for this attribute. Hope this helps somebody ! Cheers.

Categories : Android

Android: audioRecorder.getState() sends 0 in Samsung Galaxy Tab
I see two issues here: You are using a hardcoded value for bufferSizeInBytes. According to the documentation, if you use a value smaller than getMinBufferSize will result in an initialization failure. Why don't you use your value of bufferSize in the constructor? Also, use the same value of channelConfig when calling getMinBufferSize. Similar to the answer in this question, someone may have not released the AudioRecord resources. You could make some changes to your if statement as shown in the code block below. If this is true, then your code will fail while trying to initialize a bit-rate of 44100, release the resources correctly and then successfully initialize a bit-rate of 8000. If you still want to have a bit-rate of 44100, use new int[] {44100, 44100, 8000, 11025, 16000, 22050} T

Categories : Java

Phonegap camera crash on android 4.1.2, samsung galaxy s3, HTC
I had a similar problem. You require the following to get this to work: Make sure "uses-feature" tag appears after "application" tag. <uses-feature android:name="android.hardware.camera" android:required="false"/> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/> <application ...... I hope this resolves your issue.

Categories : Android

Surprisingly I can't use back camera in android using OpenCV in Galaxy S4
you can look at this question that I post: http://answers.opencv.org/question/20054/video-get-stuck-on-galaxy-s4/ I have also the same problem, till now I didn't solve this problem. you can see here the status of the bug: http://code.opencv.org/issues/3113 . I use MediaMetadataRetriever that is much slower and you have to save the video first.

Categories : Android

NullPointer Exception in android 2.3,its working fine in Galaxy nexus
Try like this: ImageView thumbImage =(ImageView) findViewById(R.id.imageView1); thumbImage.setDrawingCacheEnabled(true); Bitmap pr = Bitmap.createBitmap(thumbImage.getDrawingCache()); thumbImage.setDrawingCacheEnabled(false); Or if it will not work then try calling thumbImage.buildDrawingCache() before thumbImage.getDrawingCache().

Categories : Android

Android TextSize not Fix properly in Nexus 4? but it working fine in Galaxy s3?
Just guessing, but for text dimensions you better go for sp units, as they are dependent on device text size preferences.- <dimen name="size_11">9sp</dimen> More info about dimens units here An sp is the same base unit, but is scaled by the user's preferred text size (it’s a scale-independent pixel), so you should use this measurement unit when defining text size (but never for layout sizes). Besides, when I've had issues setting text sizes programmatically, I'd solved them setting text size like this.- resultMatchCountText.setTextSize(TypedValue.COMPLEX_UNIT_PX, getActivity().getResources().getDimension(R.dimen.size_11));

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

getting null on current location on Samsung Galaxy Grand android?
Check this for the answer, for short To programmatically kick start your app for "current location" run the following code before you call getLastKnownLocation YOUR_APPLICATION_CONTEXT.getLocationManager().requestLocationUpdates( LocationManager.NETWORK_PROVIDER, 0, 0, new LocationListener() { @Override public void onStatusChanged(String provider, int status, Bundle extras) { } @Override public void onProviderEnabled(String provider) { } @Override public void onProviderDisabled(String provider) { } @Override public void onLocationChanged(final Location location) { } }); Some recommendations for fixing GPSTracker issues may be, to set it as 1 min 1 meter private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 1; private static final

Categories : Android

Android Custom Camera video capture Issue with samsung galaxy tab
I suspect this fixes your problem as well. When dealing with the camera on Android you often have to deal with device specific issues.

Categories : Android

How to solve distorted image issue in android custom camera for galaxy S4
I had the same problem, if you mean that photos were taken with aspect ratio 4:3 and saved with aspect ratio 16:9 (they were outstretched). My problem was, that since I chose one of supported PictureSizes, I didn't do the same with the PreviewSizes. Supported PictureSizes for Samsung G S4 are only with aspect ratio 16:9, however default PreviewSize was set to 1440x1080, which is 4:3. When I set both sizes with the same aspect ratio, picture was taken with no distortion. Hope it will help.

Categories : Android

Android tablet (Samsung galaxy tab) - table messes up on orientation change
I am answering this here so if someone else run into the same thing can have an easier time The issue is with the webkit browser(like the android stock browser) as it does not fully render the table. As my coworker explains: there is a redraw flag or something like that, and when you switch orientation this flag does not reset so it does not fully redraw perfectly. To solve this, simply hie the element and check it's height then show. Using jquery it is a very simple process $('.element').hide().height(); $('.element').show(); http://jsfiddle.net/FzSwP/5/ Chaining it will most likely work as well, I am just putting it in 2 lines so it is easier to follow. I have seen this on desktop chrome as well when displaying tooltip and the same thing will fix the issue.

Categories : Javascript

Android simulate touch
Start Here The IDE used is Eclipse. The site I linked has everything to get you started, including download links to the java sdks you need, and the ADK to compile your code to run on a device emulator.

Categories : Android

How to Control media player android while Playing Rtsp Link on Samsung Galaxy S3?
It is not enough of information. I think adding more code, may be even full file, would help. As per my experience, S3 is less troublesome device on playing rtsp streams, I have created rtsp player too. You might have done something wrong. Let's also ask what the stream you are trying to play, hls, anything else? You could also do the following: try to play the stream with some desktop player: quicktime, mplayer. Do they play it right? try to validate the stream with one of those rtsp streams validators, do they find it ok?

Categories : Android

Texture target with GL_HALF_FLOAT_OES or GL_FLOAT makes framebuffer GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT on Galaxy S4 (Android 4.2)
Are you sure the extension GL_EXT_color_buffer_half_float is exposed in your device? According to this question at Imagination forums, the S4 supports the extension but it can't be used. [..] GL_OES_texture_float allows an application to use floating point textures. You would need an additional extension to render to a floating point target (e.g. EXT_color_buffer_half_float). Unfortunately, this extension is not exposed on the PowerVR Galaxy S 4.

Categories : Android

Android: Simulate the back button twice
I'm not sure I completely get you but you could use the flag FLAG_ACTIVITY_CLEAR_TOP to bring it back to A and remove B. Intent i = new Intent(C.this, A.class) i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i); finish(); Run this code when you get the error and it will bring A back up. And if the "Back" button is pressed you will still get to B. Another option you have is to store the information in something like SharedPreferences and load the data from there but this may be unnecessary for your situation.

Categories : Android

Android: How to use "adb shell wm" to simulate other devices
I guess overscan is setting the space of the screen ("the margin") that is not used. Try with something like adb shell wm overscan 200,200,200,200 start an app and you will see the difference. In Home the difference is not so clear. If this is really useful in combination with size and density I don't know. I did some tests but no useful result. It is a little complicated (?) to see what values to use...

Categories : Android

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

Android Foreground Service - Notification that doesn't show Samsung Galaxy device lights
You are using DEFAULT_ALL for the defaults, which will also give you default lights, and apparently on your device, default lights including lighting them up. I would remove setDefaults() or limit it to be ones other than the lights (Notification.DEFAULT_SOUND | Notification.DEFAULT_VIBRATE).

Categories : Android

Android: simulate long running time
You don't really need to wait any specific amount of time. You just have to do something that eats memory. This could be a special app you create for the task, but you don't really need to. In my experience, most games seem to work. Games with a lot of graphics tend to work best, since they're using up a lot of memory for textures, etc. Angry Birds or Candy Crush will work also, even though there aren't advanced graphics or heavy processing(probably for the same reason they chew through the battery). Normally, after playing just a level or so, you can return to your Activity and see what got lost. Optimally, you'll be using smart ways to persist/initialize your data, so this shouldn't be that much of a problem, but occasionally you(or a user) run into something unexpected, and this can h

Categories : Android

Is it possible to simulate the event of anchors (html) with the Android interface (xml)?
If you know the position of the item in the List, you can use setSelection() in your button's click handler. http://developer.android.com/reference/android/widget/ListView.html#setSelection%28int%29

Categories : Android

Methods called by Android OS to retrieve memory? How to simulate it?
First, did you implement onResume() and onRestart() methods ? Another way, if your app need a login (Facebook, Google +, own service...), you may receive a Token who must expire after a certain time. You must ask a new token key when resume... Please post your LogCat for more help. Adrien

Categories : Android

Algorithm to calibrate joystick
You can get the position of the blue rectangle by instructing the user to move the joystick along the edges so that the values you see are the red curve. You should also instruct user to leave joystick in centered position since you usually need to know the center. Calcuated center is not always the real center position. For each axis separate those values by the side of the center they are on and find those that are the closest to the center point. That would work with calculated center. Now you have the blue rectangle. E.g. on X axis you see values ranging from 0-20 and 80-100, center is ~50 > blue rectangle is 20 - 80. Assuming you want to calibrate it so that values are 0-100 (green) you calculate correction for the x axis as calibratedX = (uncalibrated - 20) * 100 / 60 Values a

Categories : Java

Need to make Joystick With Four Directions
Refer the following sample, https://github.com/jasarien/JSController It consists of four direction button, free drag view and two buttons, it will be helpful for your question.

Categories : Iphone

Unity Joystick method C#
The UnityEngine namespace doesn't contain any class named Joystick. You can, however, access joystick input that has been set up in the Input Manager by querying Input.GetAxis(). Suppose you set up a joystick to control two axes, named "Joy0x" and "Joy0y", you could then get the input like so: function Update() { var x = Input.GetAxis("Joy0x"); var y = Input.GetAxis("Joy0y"); transform.Rotate(x, y, 0); //rotate attached GameObject } I imagine many people have posted joystick helper scripts. If you're working with one of those, please mention it.

Categories : C#



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