This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class YourApplication extends Application { | |
| @Override | |
| protected void attachBaseContext(Context context) { | |
| super.attachBaseContext(context); | |
| MultiDex.install(this); | |
| } | |
| @Override | |
| public void onCreate() { | |
| super.onCreate(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| EditText | |
| android:id="@+id/et_go" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:layout_centerHorizontal="true" | |
| android:layout_centerVertical="true" | |
| android:inputType="text" | |
| android:imeOptions="actionGo" | |
| android:hint="@string/hnt_et_go" /> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android.support.v7.app.AlertDialog.Builder builder1; | |
| builder1 = new android.support.v7.app.AlertDialog.Builder(YourActivity.this); | |
| builder1.setMessage("Please check your internet connection"); | |
| builder1.setCancelable(true); | |
| builder1.setPositiveButton("Yes", | |
| new DialogInterface.OnClickListener() { | |
| public void onClick(DialogInterface dialog, int id) { | |
| dialog.cancel(); | |
| } | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Step 1: Go to your java bin directory via the cmd: | |
| C:\Program Files\Java\jdk1.7.0_71\bin> | |
| # Step 2: Now type in the below command in your cmd: | |
| keytool -list -v -keystore c:\users\your_user_name.android\debug.keystore -alias androiddebugkey -storepass android -keypass android | |
| example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ActionBar mActionBar = getSupportActionBar(); | |
| // checking either this is home actiivty or not for | |
| // ActionBar.DISPLAY_HOME_AS_UP | |
| if (this.getClass().getSimpleName() | |
| .equalsIgnoreCase(RestaurentListActivity.class.getSimpleName())) { | |
| mActionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_TITLE | |
| | ActionBar.DISPLAY_SHOW_CUSTOM | |
| | ActionBar.DISPLAY_SHOW_HOME); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| android:launchMode="singleInstance" | |
| # add this to your activity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TextView | |
| android:id="@+id/textView_News_HeadLine" | |
| style="@style/black_extra_large_heading_text" | |
| android:layout_width="wrap_content" | |
| android:layout_height="wrap_content" | |
| android:layout_alignParentLeft="true" | |
| android:layout_marginLeft="8dp" | |
| android:ellipsize="marquee" | |
| android:marqueeRepeatLimit="-1" | |
| android:singleLine="true" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| byte[] convertBitMapToByteArray(Bitmap bmp) { | |
| ByteArrayOutputStream stream = new ByteArrayOutputStream(); | |
| bmp.compress(Bitmap.CompressFormat.PNG, 100, stream); | |
| byte[] byteArray = stream.toByteArray(); | |
| return byteArray; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.content.Intent; | |
| import android.content.pm.ResolveInfo; | |
| import android.content.res.AssetFileDescriptor; | |
| import android.database.Cursor; | |
| import android.graphics.Bitmap; | |
| import android.graphics.BitmapFactory; | |
| import android.graphics.Matrix; | |
| import android.media.ExifInterface; |