Skip to main content

Posts

Showing posts with the label how to

How to change position of MyLocationButton on new Map API v2? Explained

When an app use map and design some layout on this map (TextView, Button or image), developer needs to change position of default buttons of map view. (MyLocationButton, ZoomControl or compass...) As far as i know, there are two possible way for changing position of myLocationButton's position. 1- * - Disable it     * - Create new button programmatically     * - Add animateCamera(toCurrentLocation) to onClickListener of this button     * - And place it wherever you want But if you don't want to write all that there is a hack for that. 2 - * - findViewById() of hardcoded button with; ZoomControl id = 0x1 MyLocation button id = 0x2      * - And do whatever you want: // Find map fragment SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); // Find myLocationButton view View myLocationButton = mapFragment.getView().findViewById(0x2); if (myLocationButto...

How to Check Unread Message in Android

You can  check the number of unread SMS in android  in Android. You should use  "content://sms/inbox". Example Code: public void SmsControl(){              Uri sms_content = Uri. parse ( "content://sms/inbox" );              String where = "read = 0" ;              Cursor c = context .getContentResolver().query(sms_content, null ,where, null , null );              c.moveToFirst();               int  Value = c.getCount();              c.deactivate();        } I hope this code helps you. You can use  "content://sms"  or  "content://sms/sent" for your needs.   ...