w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » ANDROID » Page 3
Android: BLE without "peripheral” role?
1) Android 5 (Lollipop) got high level API support for Peripheral role but if the low level HW Driver does not support it or got unsolved firmware bugs or if the Vendor is too cheap to run (re)Certification for Peripheral role then Google gave a way to the Vendor to configure BLE Peripheral role with 0 (Zero) Advertiser resources. It will still have the API's at high level but will just rapport th

Categories : Android

Error in loading Send and Recv in RabbtiMQ
I had the same problem. It is because the -cp delimeters should be semicolon ; instead of : as listed in the tutorial. Tutorial had : java -cp .:commons-io-1.2.jar:commons-cli-1.1.jar:rabbitmq-client.jar Send Change to : java -cp .;commons-io-1.2.jar;commons-cli-1.1.jar;rabbitmq-client.jar Send ,and it should work

Categories : Android

How to show EditText on list view's item click in android?
You can start a DialogFragment with a EditText (How to take text input with DialogFragment in Android?) and you can handle this dialog with you list item click. Click Item -> Open Dialog Asking Password -> Return the password from the edit text -> Do Something you want. if you want show a edit text in the listview item, you can set the item as view.invisibly and set the visibility with the event

Categories : Android

Android export process keeps failing
There are several possible reasons for ClassNotFoundException that I have run into. Here are a few suggestions: You mentioned "clean and rebuild" - for some reason (usually related to compiling the R.java file) I occasionally need to "clean" more than once for a good production build. I can even do a "clean" and export on a test that is fine, then do an export with a fail. I've probably done ove

Categories : Android

Android Eclipse Phonegap SQLite Error- Unfortunately has stopped
Try setting var db; before the line $(document).ready(function(){ and then inside of function onDeviceReady(){ set: db = window.openDatabase("Database", "1.0", "MyContactsDB", 200000); This will ensure that db is globally accessible. I am not sure that would cause the application to crash, but it's worth a look.

Categories : Android

Tablets missing in supported device of the Google Play developer console
when you set "uses-feature" your app will not show in play store for devices that don't have the request hardware. For example not all tablets have flash, so your app will not be visible for those tablets. You need to add for each "uses-feature" the attribute "required" and set it to false. You can read about it in http://developer.android.com/guide/topics/manifest/uses-feature-element.html

Categories : Android

Android onCreate called on Second Activity
when I try to open it again it starts from Activity B. Is this expected? yes, this is the expected behavior. when you press the home button (not the "back button") the entire task is sent by default to background, and when re-launching it (from recent tasks screen or the app icon at the home screen) it coming back by default to foreground with the same stack state as it was. same behavior a

Categories : Android

SimpleCurosrAdapter isn't work
No, deprecated is not causing this problem. This error clearly tells you exactly what the issue is - your database does not contain a column called _id, but this column is required 11-18 15:34:24.405: E/AndroidRuntime(2730): Caused by: java.lang.IllegalArgumentException: column '_id' does not exist This line points you to the exact line of your codebase that caused the above exception 11-18

Categories : Android

Blur effect Android
There are some ways to do this,For API < 14, you could use the flag WindowManager.LayoutParams.FLAG_BLUR_BEHIND, but it's been deprecated and built-in blurring is no longer supported on higher APIs.So you can create a blurred bitmap and set it as background for the page. Refer the following links for more details. Blur effect like in the app Etsy? http://nicolaspomepuy.fr/blur-effect-for-and

Categories : Android

CardView inside RecyclerView has extra margins
did you check if it is margin or padding? (Dev Options / show layout bounds) CardView adds padding in platforms pre-L to draw shadows. In L, unless you set useCompatPadding=true, there should not be any gap. Adding negative margins (although it is ugly) should work. If it is not, please add some more code on how you are adding them and how you are setting up the RecyclerView.

Categories : Android

How to get R.attr.colorPrimary in pre lvl 21 devices
Actually I was just being plain stupid. In order to use R.attr.colorPrimary in pre 21. You cannot use android.R but rather the resources of your application.

Categories : Android

Google places api add constraints
Try this way: HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://maps.googleapis.com/maps/api/geocode/json?latlng=" + latitude + ","+ longitude + "&sensor=true"); Complete Code: class AsyGet extends AsyncTask<LatLng, Void, String> { ProgressDialog dialog; public AsyGet() { // TODO Auto-generated constructor stub } @Ove

Categories : Android

I am going to develop a new Quiz application in Android. When I click on the wrong option it has to show red color how can we do that?
add these statement where you find a wrong ans, that is in else part, where you need to set a red color. if your color.xml is like: <color name="errorColor">#f00</color> then uans.setTextColor(getResources().getColor(R.color.red)); and also set the ans with another color

Categories : Android

Scatterchart values dissapear when dragging
Ok, by reading the code I can see the following that could cause your problems. The first one has to do with the chart-library, the others are issues concerning your ListView implementation. Call setScaleMinima(...) and centerViewPort(...) after calling setData(...). Since you are only using one type of list-item (the item with ScatterChart in it) it the method getItemType() is not necessary. If

Categories : Android

Android: two instances of Text-to-Speech work very slowly
How about waiting for the two TTS engines to finish initialising at the start of your app, before any user interaction (do this by creating an OnInitListener and waiting -- e.g. with a semaphore -- until the onInit() method is called), so that by the time the user gets to the point in the app where the buttons are introduced, you have the two engines already initialised?

Categories : Android

Add custom layout to ActionBar with Gravity Left?
Try with this in your Toolbar xml config android:contentInsetStart="0dp" Base on Chris Banes' response http://stackoverflow.com/a/26495926/1568429

Categories : Android

How to navigate to another activity from activity launched from Notification Without Overriding OnBackPressed()?
Inside the displayNotificationOne() replace stackBuilder.addParentStack(FirstActivity.class); with stackBuilder.addParentStack(NotificationActivity.class); if you want the user to navigate from NotificationActivity to FirstActivity when the back button is pressed, also you will be able to go from FirstActivity to the MainActivity here becuase of the manifest. If you don't want that to happen

Categories : Android

Why Location services is Part of the Google Play service APK?
You can also check this link, Overview of Google Play Services Q1. Why the Google play store needs to be installed to get the location update or user activity status. Google Play services APK contains the individual Google services and runs as a background service in the Android OS. You interact with the background service through the client library and the service carries out the acti

Categories : Android

SeekBar change gray color
Try creating progress.xml: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background" android:drawable="@drawable/background_fill" /> <item android:id="@android:id/progress"> <clip android:drawable="@drawable/progress_fill" /> </item>

Categories : Android

App Crashed: After installing in Emulator
The error showing that the app did not found MainActivity, try to write the ActivityName with full package name in Android.Manifest like @Opiatefuchs said in the comment. Declare activity-name not as MainActivity but as "com.iueamessenger.MainActivity"

Categories : Android

How to toggle focus between buttons without losing focus on clicking button
Every time you focus a button inside your thread, store a reference to that button in a variable accesible by your class. Then, on your button's onClickListener in addition to your program logic, request the focus to the last focused button. Not sure if it will prevent your on click from changing the image of the button and causing some glitches. If that would be the case, you can try to perform

Categories : Android

When does touching the screen outside an AlertDialog cancel the AlertDialog?
You can control it with dialog.setCanceledOnTouchOutside(true); For more information : How to dismiss the dialog with click on outside of the dialog?

Categories : Android

ViewPager inside fragment, how to retain state?
You will need to do 2 things to resolve the issue: 1) You should use onCreate method instead of onViewCreated to instantiate LfPagerAdapter; i.e.: public class MainTabFragment extends Fragment { private PagerSlidingTabStrip mSlidingTabLayout; private LfPagerAdapter adapter; private ViewPager mViewPager; @Override public void onCreate(Bundle savedInstanceState) {

Categories : Android

Detecting when a circular motion has been made - Android
You will have to code it by yourself. Have a look at this good example: http://gamedevelopment.tutsplus.com/tutorials/how-to-detect-when-an-object-has-been-circled-by-a-gesture--gamedev-336

Categories : Android

How to parse complex xml
You can use ksoap2 for Android to parse SOAP responses. Generally speaking, SOAP is a pain in the *** on Android. For general XML parsing I would recommend SimpleXML to map XML to Java classes/ objects.

Categories : Android

Error when calling dialog.show "Source not found" (Android)
you are using wrong import for support package import android.app.Fragment; you should use import android.support.v4.app.Fragment; and also for getFragmentManager() use getSupportFragmentManager() instead

Categories : Android

AltBeacon scanning iBeacon on Android
The most likely problem is that your app does not have the proper AndroidManifest.xml entries to declare the beacon scanning service. This is generally done automatically using manifest merging from the library's manifest. If you are using Eclipse, you need to turn on manifest merging as described in the library's Quick Start guide: Edit your project.properties file and add the line: manifes

Categories : Android

How to inject a custom view to a viewGroup declared in an xml at runtime?
Use ViewGroup addView() method. Also you can use ViewStub

Categories : Android

Android unity3d image path
To access a file in the assets folder of your apk: String path = getAssets() + "/texture/image.png"; iTextSharp.text.Image imageHeader = iTextSharp.text.Image.GetInstance(path); The path should be something like: file:///android_asset/texture/image.png EDIT: Can't use getAssets in Unity - Then there will not be a direct system-mounted file path for files in the assets folder. What I usually

Categories : Android

application not fit to the android virtual device
Basically, your designer and emulator are using different screen dimensions. You can change the designer to use the same screen dimensions. Currently, from your screen shot you're using the Nexus One layout. From what I can tell the emulator doesn't look like the Nexus One screen dimensions. With Android it isn't as simple as 1 layout for all dimensions, screen sizes and devices. You have to imp

Categories : Android

trying to deploy sencha app for android .Not able to figure out the error in this build
Had the same problem. The problem was with the debug.keystore file in .android folder. Go to the cordova folder of your project and in console give : cordova -d compile If you see the error info with expired file Go to C:Users(Your name).android and delete file debug.keystore.

Categories : Android

Save an image stored in the resources/drawable folder inot the gallery
Get image bitamp : Bitmap bm = BitmapFactory.decodeResource(getResources(),R.drawable.ic_launcher); Store bitamp on given path : File file = new File( Environment.getExternalStorageDirectory().toString(), "ic_launcher.png"); outStream = new FileOutputStream(file); bm.compress(Bitmap.CompressFormat.PNG, 100, outStream); outStream.flush(); outStream.close(); Add this permission in AndroidManif

Categories : Android

How to add cancel button to ErrorDialog of GooglePlayServicesUtil?
No, because the GooglePlayServicesUtil method returns a Dialog and not an AlertDialog. If you want this sort of custom behaviour, you need to implement your own AlertDialog (or something similar) which handles starting an activity for result, displaying a proper error message for a given status code, etc. It would be quite a hassle to achieve - if you want cancellation just use setCanceledOnTouch

Categories : Android

.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification android
You shouldn't call in doInBackground() any method that updates the list.You should collect everything in doInBackground, return it as a result and then update the list in onPostExecute. because onPostExecute and onProgressUpdate are executed in the UI thread, while doInBackground is executed in a different Thread.

Categories : Android

How to wrap text in a TexView Android
Try to use LinearLayout for your design instead of GridLayout : <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <ImageView android:id="@+id/img" android:layout_width="150dp" android:layout_height="225dp" android:contentDescription="@string/imgdesc"/> <LinearLayout android:layout_width=

Categories : Android

Styling ActionMode ActionBar in Android 5.0 Lollipop (with AppCompat)
Just add these two lines to the theme: <item name="actionModeBackground">@color/theme_primary_dark</item> <item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>

Categories : Android

How can I know the startActivity intent from other application?
Have you tried using getIntent() ? Then you can do: this.getIntent().getExtras(); After that if you need new intents just override the onNewIntent function in your activity.

Categories : Android

set background screen blurr when running progressbar in android
Put ProgressBar control to your layout xml <ProgressBar android:id="@+id/progressBarDialog" style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:visibility="gone" android:indetermi

Categories : Android

Injecting entity object while calling google cloud endpoint from android
The way you word your question, it seems the call is silently failing. That can't be. You must be receiving some kind of exception or log somewhere which could help you identify your issue better. You could read this article to refresh on cloud endpoint APIs and android. If you are having trouble passing an arraylist of objects from your client to the API, I would suggest checking some things:

Categories : Android




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