w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to check whether an application is being closed in android
From the Android Developer Guide: There are a few scenarios in which your activity is destroyed due to normal app behavior, such as when the user presses the Back button or your activity signals its own destruction by calling finish(). The system may also destroy your activity if it's currently stopped and hasn't been used in a long time or the foreground activity requires more resources so the system must shut down background processes to recover memory. When you switch between apps by pressing the home button, Android pauses the activity and resumes it when you return to the activity. For the most part, the OS decides when to quit an application so it wouldn't make sense for you to log when an activity is destroyed. I would suggest overriding the onPause() or the onSto

Categories : Android

Android BOOT_COMPLETED not received when application is closed
was struggling with the same problem, the reason is you are using Log.d to track you application in logcat, unfortunately when you restart your phone the application is receiving the BOOT_Complete but you can't see it because it's not logging to logcat. try making a Toast with some text instead of Log.d to make sure if BOOT_COMPLETED is or is not received. hope this Help.

Categories : Android

How many ways for an android service to communicate with other components within the same application
Like gunar said, you can also use an Event Bus. The most popular are: Otto (square) EventBus (greenrobot) The documentation it's self explanatory but if you need help to get started let me know. Regards, Ryan

Categories : Android

Android google map v2 is not working after the application is closed and reopened
I think that the best place would be to create a class that extends SupportMapFragment, and initialise the map in: @Override public void onAttach(Activity activity) Besides that though, I think if you initialise the map in onResume of the container activity it should be ok. But if you by initialising you mean adding the mapfragment to the activity, I would suggest doing it in the xml or in your activity's onCreate. Just my two pennies.

Categories : Android

Send notification from a service running in background after application is closed in Android
Notification: NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); Notification.Builder builder = new Notification.Builder( getApplicationContext()); Intent intent = new Intent(getApplicationContext(), YourActivity.class); intent.setAction("notification"); PendingIntent pendingIntent = PendingIntent.getActivity( getApplicationContext(), 0, i intent,PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT); builder.setSmallIcon(R.drawable.app_icon) .setContentTitle("Next Appoinment....") .setContentText(response)

Categories : Android

Android Application Error "Unfortunately App has Stopped" - Radio Buttons
The problem is in your DisplayMessageActivity class. It appears you don't have a onClick() method. So when you click the Button it crashes. Since you have in your xml android:onClick="onClick", you need a function in that class like public void onClick(View v) { // put code here } It looks like you misnamed your EditText unless this was a copy/paste error. You have private EditText text; But you initialiize EditText editText = (EditText) findViewById(R.id.edit_message); then you try to call a function on the uninitialized text if(text.getText().length() == 0){ resulting in a NPE. I don't know if those are suppose to be two different ones but, either way, I don't see text initialized anywhere

Categories : Android

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

Why should we use string resources in the various android components - "android:text" property?
Putting the strings in a string resource allows your app to support multiple languages (by having a string resource file for each language you want to support). It also prevents duplication in the case where you use the same string multiple times. You simply define it once in a string resource and refer it where ever you need to use it. If you later need to change its value, you only change it in one location (the string resource file).

Categories : Android

Android automate usb debugging (rsa fingerprint)
Actually, I realized I made a mistake when flashing the boot.img file back onto the device. Now that I've got it flashed correctly, I am no longer prompted with the USB Debugging dialog in the beginning. Make sure you have the following flags set in your default.prop: ro.debuggable=1 persist.sys.usb.config=mtp,adb ro.adb.secure=0 and you should be good to go. With these set, it's not necessary to pre-install an APK into the system/app folder to change the ADB_ENABLED settings using Settings.Global.putint(...)

Categories : Android

How to automate basic sanity on android?
Consider using Android Compatibility Test Suite (CTS). For example, after you've downloaded the CTS test package, to test the Camera you could issue a command on the host that looks like the following: ./cts-tradefed run cts --class android.hardware.cts.CameraTest

Categories : Android

Linking my own application and android map application (application default map on android device) its possible?
You can do this. You need to launch the Maps activity with an Intent that contains the info that Maps needs. Here is a link to another SO question that will help.

Categories : Android

Android app cannot connect to internet when try to run automate testing using TestDroid
add this inside your manifest xml tag <manifest xlmns:android...> ... <uses-permission android:name="android.permission.INTERNET"></uses-permission> </manifest>

Categories : Java

Android 4.0 does not recognize null
You need to use .equals() instead of == to check if the String is "null", and == instead of equals() to check for null. See http://stackoverflow.com/a/767379/675383

Categories : Android

adb does not recognize Android 4.0.4 device
If you haven't managed to connect it through usb, you can try the network connection. Add your device to the same network, then type in the command prompt: adb connect your_device_ip_address

Categories : Android

c# server won't recognize android
127.0.0.1 is localhost, your own machine. If you host a server in C# on your local PC and you have a Java application that looks a lot like Android that is surely running on another machine (your cellphone, tablet or enmulated cellphone or tablet) that is not the same machine. You need to communicate by using an IP address that both machines know and both machines trace back to the same physical box. On your PC, 127.0.0.1 is your PC. On your tablet, 127.0.0.1 is your tablet, not your PC. Look up the IP of your PC in your network (Enter ipconfig in the Console if you are running Windows) and use that. Make sure you use a public IP when you deploy.

Categories : C#

Android emulator cannot recognize that GPS is enabled
So, there is actually another settings just for Google apps...which is why the error message in Maps said Please enable Google apps location access. There's a separate Google Settings app separate from regular Settings. Classic misunderstanding of the error message...

Categories : Android

Android gui components from 4.x
I figured it out. They both inherit from CompoundButton. So it's ok to import android.widget.CompoundButton. No need to import ToggleButton or Switch. Case closed.

Categories : Android

How recognize different URL requests to perform different actions using Android
Here is the modification of the code, but still cannot recognize the IP address: public void run() { try { serverSocket = new ServerSocket(SERVERPORT); while (running) { // LISTEN FOR INCOMING CLIENTS Socket client = serverSocket.accept(); try { BufferedReader in = new BufferedReader( new InputStreamReader(client.getInputStream())); String line = null; String IP = "192.168.0.111"; line = in.readLine(); if (line.equals(IP)) { new ServerHandler(client).start(); LockStatus.getInstance().setMyVar(true); Log.i(TAG, "

Categories : Android

Android doesn't recognize the u202A and u202c
You could use a custom font. You should be able to find a suitable ttf file by doing a quick search. This outlines the general approach. Some unicodes in Android EditText can not show correctly

Categories : Android

Eclipse doesn't recognize Android device but adb does
This is a weird one but see my answer here: Eclipse not recognizing my android phone - says target unknown I know, I discovered it by fluke, change how the memory stick mounts and somehow it works. I hope this helps, adb used to see my desire HD, but it was Android 2.3 eclipse wouldn't until I fiddled with the memory stick mount settings. If this doesn't help tell me via comments and I'll ask for more info and such but this weird fix often works for me.

Categories : Android

Application gets closed when terminal is closed, how to stop this?
Use nohup to prevent child processes from being killed when the terminal closes. spawn nohup /usr/bin/firefox https://www.google.com/ I assume there's more to the script, since there's no need to use Expect just to start firefox.

Categories : Python

Android Droid Query How To Recognize Pinching and Zooming
The droidQuery library does not currently support pinch zooming, however you can use droidQuery's swiping ability with Android's ScaleGestureDetector to get the gesture detection you are seeking. The following example, should help you: public class MyActivity extends Activity { private float scaleFactor = 1.0f; private ScaleGestureDetector scaleGestureDetector; private SwipeInterceptorView view; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //set main view to the main layout setContentView(R.layout.main); //get a reference to the content view view = (SwipeInterceptorView) findViewById(R.id.swipe_view); //get the scale gesture detector scaleGestureDetector = new

Categories : Android

Eclipse Won't Recognize BLU Dash 3.5 As An Active Android Device
First of all, are you able to transfer data to the phone normally? If you can, don't bother with the second part below. If you can't transfer data, look at this second part. When you bought the phone, did it come with a driver disc? If it did, install the drivers from there. If it did not, try checking the official manufacturer site to see if there's a driver online.

Categories : Android

Display Android SDK Manager, Android Virtual Device manager buttons in eclipse?
Try this: window->customize perspective->command groups availability->andriod and avd managers (CHECK this option) and then Tool bar visibility->andriod and avd managers(CHECK this option) Hope it helps..:)

Categories : Android

New version ADB doesn't recognize iBall Slide 6309i(Android 4.1.1)
adb has a hard-coded "whitelist" of USB Vendor IDs. If your device's manufacturer is not on that list - you need to add the device's Vendor ID in 0xffff format to ~/.android/adb_usb.ini (or %USERPROFILE%.androidadb_usb.ini in Windows). For more details check this adb device detection page.

Categories : Android

Change android phone's System date on button click from android application
On Android, the only way for an application do have write access to the time&date is to get the SET_TIME permission, which is only possible for "applications that are in the Android system image or that are signed with the same certificate as the application that declared the permission." (see signatureOrSystem protection level). The only way for your application to reach this protection level is to run on a rooted device, or build and sign your own android rom. If this is your case, you can easily use the AlarmManager or simply the Calendar instance. Good luck!

Categories : Android

android application directly login using saved account credential in android device
This is an in-depth look into how you can authenticate based on the users Android credentials, has an example of how things work and how the UI should be try this use some refrence api also available link You can get help from android developer blog link

Categories : Android

Cannot create new Android application project or access Android preferences using Eclipse Kepler
Ran into this same problem today running a Windows 7 machine. It has been a while since this question has been asked, but having an answer here might prove useful since this thread is ranking highly on Google for the error message: I found that cleaning all projects in Eclipse and restarting it once it was finished solved the issue and I was able to successfully create a new Android project afterwards. Eclipse menu: Project >> Clean Similar problem/answer found on stackoverflow.

Categories : Android

Hi.while developing OCR application in Android i'm getting Error as "Unfortunately OCR test has stopped" in Android emulator
The error is occuring at: edu.sfsu.cs.orange.ocr.CaptureActivity.initOcrEngine(CaptureActivity.java:715) ie line 715 of class CaptureActivity. Furthermore, the cause listed in the log (towards the end) is that it could start a library to initiate the class TessBaseAPI. Assuming that there are no errors when you are writing your code in eclipse, then a likely cause is that a library you are using isn't be added to the all when it is sent to the phone or emulator. To solve this, you need to edit the project properties to include the libraries you have added to the project. See Adding a library/JAR to an Eclipse Android project.

Categories : Java

Get closed canvas shape in android
Try the following way. public class MainActivity extends Activity { private ArrayList<Path> _graphics = new ArrayList<Path>(); private Paint mPaint; float x1, x2, y1, y2; boolean isDraw; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new DrawingPanel(this)); System.out.println(x1 + " " + x2 + " " + y1 + " " + y2); mPaint = new Paint(); mPaint.setDither(true); mPaint.setColor(0xFFFFFF00); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(3); } class DrawingPanel extends SurfaceView implements SurfaceHolder.Callback

Categories : Android

Application using bluetooth SPP profile not working after update from Android 4.2 to Android 4.3
I found a work around. It is disconnected if there is no streaming activity for a few seconds. I managed to have some output or input streaming several times per second, and it never disconnects now.

Categories : Android

Is it possible to create an Android application where the server side run on Android Mobile?
When you say the server side is a phone app, you imply that the phone is always on, the app is always running, and you need no central storage whatsoever. You also lose any ability to keep analytics for your service, which is a crucial part of any startup. If you want your app to have the server available even 80% of the time, and you want to keep a central database of what's going on, you must have some server you can control. There are a lot of very cheap and manageable cloud solutions, so you don't need to buy an actual server.

Categories : Android

Android ScrollView keeps redrawing it's components endlessly
The meaning of the returned boolean value is documented as: True if the listener has consumed the event, false otherwise. Not really explaining. "Consumed" means that the other listeners do not need to see the event. "Not consumed" means that the listener may not see the subsequent related events. It is not clear for me what the code was intended to do -- it definitely just consumes two types of events. But you could add event.getAction() to the log and see what is going on. As I remember, different versions of Android may generate a bit different sequences of events for the same gesture.

Categories : Android

Android : Updating UI components from async class
move your UI thread related code to onPostExecute || onProgressUpdate for example: protected void onPostExecute(Long result) { // after finishing fetching your image from URL, update the ImageView here images[i].setImageBitmap(bmp); } I can see you are downloading multiple images inside the AsyncTask then you can use PublishProgress you need to update your AsyncTask definition to allow passing Bitmaps to publishProgress method as follow: AsyncTask<whatever..., Bitmaps, whatever...>() Then publishProgress(yourBitmapObject); protected void onProgressUpdate(Bitmap[] values) { images[i].setImageBitmap(values[0]); };

Categories : Java

Android SDK not installing components on linux (ubuntu)
is there a way to launch the sdk as superuser via command-line? sudo .../tools/android where ... is the path to your Android SDK installation. In your case, from the error message, this would appear to expand to: sudo /opt/android-studio/sdk/tools/android

Categories : Android

Android - Buttons are "following" other buttons in layout
The easiest way would be to wrap each set of Buttons in a LinearLayout and use the property android:layout_below="@id/layoutIdAbove <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/check" android:textAppearance="?android:attr/textAppearanceSmall" /> <LinearLayout android:id="@+id/LL1" ... android:layout_below="@id/textView1"/> <ImageButton android:id="@+id/imageButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="64dp" android:onClick="audio" android:src="@android:drawable/ic_lock_silent_mode_off" />

Categories : Android

Is it possible to code an address in a web page so that iOS and Android will recognize it and load their native map program?
Unfortunately there is no easy tag you can use across platforms but I did find a few suggestions for iOS under this topic: Link to iPhone map App from HTML page Perhaps there is something similar for Google Maps on Android?

Categories : Android

Connection closed before request completed - Android ION
If you don't mind checking, I think the underlying cause of this bug was fixed recently: https://github.com/koush/ion/issues/18 https://github.com/koush/AndroidAsync/issues/55 Was related to SSL.

Categories : Android

Dialog gets closed on screen rotation android
This is because your activity is recreated on orientation change. See: Activity Life-cycle Management [developer.android.com]. UPDATE: The dialog for the list preference is a part of the preference hierarchy and is created by android. Hence it is saved and restored by android in the PreferenceActivity's onSaveInstanceState() and onRestoreInstanceState() calls. Whereas you are creating the dialog for your Preference "prefAlert" and must save and restore in your class' onSaveInstanceState and onRestoreInstanceState methods. See this: Recreating an activity [developer.android.com]

Categories : Android

How can I save my Android application so that the end-user can execute it without the Android SDK
The "exe" for android is called apk. I suggest you to look at this question. You'll need to build the apk and sign it in order to be able to run it.

Categories : Java



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