w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » ANDROID » Page 2
How to write the text file using sensetalk - eggplant functional
To append information to a log file, just do this: put "this is a new log entry" & return after file "/path/to/log/file" If the file doesn't exist, it will be created. After that, a new line will be added each time. If you'll be doing this a lot you may want to create a custom handler that you can call. This one puts the date and time before each log entry: to logEvent theEvent put the

Categories : Android

Android Google Map API: How to get minimum and maximum coordinate can visible on map
I think you can use this code for determining map's bounds GoogleMap map; map.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() { @Override public void onCameraChange(CameraPosition cameraPosition) { //those are corners of visible region VisibleRegion visibleRegion = map.getProjection().getVisibleRegion();

Categories : Android

GCM - no devices registered
I guess you should fill SERVER_URL in gcm-demo-client/src/com/google/android/gcm/demo/app/CommonUtilities.java and check whatever the HTTP call to the servlet http://Your-IP/register is really executed after the GCM registration to Google in order to let the gcm-demo-server, that you are using, to run correctly and send the push notification to that Registration ID. Don't forget to keep the ser

Categories : Android

Debug Android Wear Device over USB
You need to allow ADB debugging in Developer options on Wear device, and after you connect watch-PC by USB you will be prompted on the phone to "allow USB debugging for particular PC", you click yes and your smartwatch should be visible on adb list, also you should see log and be able to deploy apps right away - just as any phone in debugging mode.

Categories : Android

Database created but records no records inserting
KEY_COUNTRY + "TEXT," + KEY_CONTACT + "TEXT)"; You're missing spaces here between column name and type. Add the spaces. Uninstall your app so the old database with column names like countryTEXT is removed and onCreate() is executed again.

Categories : Android

Should app check if device has calling functionality when using ACTION_DIAL intent?
I would use PackageManager and resolveActivity() to see if anything will respond to your configured ACTION_DIAL Intent. That would handle: Devices that do not have native telephony and have no dialer, as resolveActivity() should return null Devices that do not have native telephony but do have a dialer (e.g., VOIP), as hopefully the authors of that dialer have ACTION_DIAL support Devices that do

Categories : Android

android login sqlite with username and password
use double ? and send two parameter in array. like: Cursor cursor = db.query(usm_Users, null, " UserName=? and Password=?", new String[] { username,password }, null, null, null);

Categories : Android

Placing LinearLayout to the bottom of other LinearLayout
I guess if you try this, it will work. Here I'm putting the two lieaner layouts inside a relative layout, so then I can manipulate where they are going to be on the screen. <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android

Categories : Android

How to use endpoints for Android with App Engine Search API
The combination does make sense. App Engine as a platform is so powerful exactly because you have access to so many APIs and services like search API and enhancements to your workflow like the Endpoints system, instead of simply defining an API servlet and your own protocol (or implementing jsonrpc2.0, for example) Yes, you can use an endpoint API function to run any kind of code you could run an

Categories : Android

How to create modal popup in Android?
You can use the android:theme to make an activity look like a dialog. Add a tag similar to this to your activity in the Android Manifest. <activity .... android:theme="@android:style/Theme.Holo.Light.Dialog" ..../>

Categories : Android

Setting Elevation in XML on AppCompat CardView on Android 5.0
You have to use the cardElevation attribute <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" card_view:cardElevation="4dp" />

Categories : Android

Android calendar view date color
Your best bet might be to create your own CalendarView class i.e. CalendarViewCustom based on the source code found here. You could then add an extra method to the LegacyCalendarViewDelegate class similar to the setFocusedMonthDateColor() method to iterate through the weeks and set a date and colour in the WeekView class (might be worth storing these key/value date/colours as an Map collection

Categories : Android

Cloudpebble "Installation failed. Check your phone for details."
The answer to my particular issue, as it turns out, was that I had unused fonts. It's not a very obvious problem, so I hope this helps others out. The main issue really was poor error reporting from cloudpebble due to the lack of error clarification returned from the pebble app to cloudpebble. I have opened an issue on the cloudpebble github (that's where I found the answer) so if any further de

Categories : Android

android is http.keepalive false necessary when using okhttp
You can change that to true with no problems. http.keepAlive just tells the client that it can keep the connection to the server open, rather than renegotiating a connection every time you do something. There shouldn't be any consequences to enabling it; at least, not in my experience.

Categories : Android

Android Search specific item in Listview
useful,but my xml file is frequently upgraded i can't use this method,i need that while typing my listview show the result(just like your example,but with action bar) this is the script: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Get the view from listview_main.xml setContentView(R.layout.listview_main);

Categories : Android

how to get object's attributes
Just create accessor methods for each field. Assuming you have declared your fields like this: private String title; private String desciption; create the accessor methods in your class definition like this: public String getTitle() { return title; } public String getDescription() { return description; } then you just call these methods to get the appropriate value.

Categories : Android

Android - spinner within dialog won't populate
Okay so what I did wrong was inflating/creating two independent views with the same context. First I did: View v = inflater.inflate(R.layout.diaglog_add_match, null); And then: builder.setView(inflater.inflate(R.layout.diaglog_add_match, null)) So I set the view for the builder as a new view, and not the same ones I used for the spinner. So instead if I do: View v = inflater.inflate(R.la

Categories : Android

Android layout issue with sibling of RelativeLayout
this error is because parent of TextView and LinearLayout are not same. if you want to put TextView and ProgressBar horizontal , change their parent's orientation to horizontal

Categories : Android

android : Save a value even if the app was closed
There is a librbary called GSON its good for serializing objects to json that is simple string. Than you can save it to shared preferences on application close. And ofcorse deserilize them when you need. device obj = new device (); Gson gson = new Gson(); String json = gson.toJson(obj); This is how to wrire it in preferences: PreferenceManager.getDefaultSharedPreferences(context).edit().putStr

Categories : Android

Are there any official APIs/Samples/Tutorials for implementing the new Material-Design-guidelines?
While the new API provides some new UI elements like like CardView (that have been already included in the support library) there are no new specific APIs for material animations, those animations abilities already exist in the current API. The Material theme does provide default animations and activity transitions, however you need to do the rest by your self and as mentioned in this tutorial

Categories : Android

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




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