Skip to main content

Posts

Showing posts from January, 2013

GPS ON or OFF without Viewing Settings Page.

I've searched for GPS ON and OFF without passing intent for getting Settings page . Now,I got a solution for that .. To TurnOn, I used the snippets below, String set = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(!set.contains("gps")){ final Intent gpsIntent = new Intent(); gpsIntent .setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider"); gpsIntent.addCategory(Intent.CATEGORY_ALTERNATIVE); gpsIntent.setData(Uri.parse("3")); sendBroadcast(gpsIntent); } and to TurnOFF, String set1 = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if(set1.contains("gps")) { final Intent gpsIntent1= new Intent(); gpsIntent1.setClassName("com.android.settings", "com.android.settings.widget.SettingsAp...

Android-PageViewer

source code   here I've searched for a page Viewer to swipe the pages for the better view .. I found some of the snippets while searching for that ... I used  the dotted Indication using  CirclePageIndicator in my package "com.rakesh.view" The Java files in this package are CirclePageIndicator.java public class CirclePageIndicator extends View implements PageIndicator {     private static final int INVALID_POINTER = -1;     private float mRadius;     private final Paint mPaintPageFill = new Paint(ANTI_ALIAS_FLAG);     private final Paint mPaintStroke = new Paint(ANTI_ALIAS_FLAG);     private final Paint mPaintFill = new Paint(ANTI_ALIAS_FLAG);     private ViewPager mViewPager;     private ViewPager.OnPageChangeListener mListener;     private int mCurrentPage;     private int mSnapPage;    ...

Sample Animation to play the List of Images

I've designed the Activity with One ImageView (To get AnimationDrawables) and two buttons . One to start Playing and another for pausing it..... My Design is as Follows,   main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     tools:context=".MainActivity"     android:background="#000000">     <Button         android:id="@+id/button1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_alignParentBottom="true"         android:layout_alignParentLeft="true"         android:layout_marginBottom="61dp"         android:layout_marginLeft="22dp" ...