This file contains 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
try { | |
PackageInfo info = getPackageManager().getPackageInfo("your.package.name", PackageManager.GET_SIGNATURES); | |
for (android.content.pm.Signature signature : info.signatures) { | |
MessageDigest md = MessageDigest.getInstance("SHA"); | |
md.update(signature.toByteArray()); | |
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT)); | |
} | |
} catch (NameNotFoundException e) { | |
} catch (NoSuchAlgorithmException e) { |
This file contains 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
./adb shell monkey -p com.example.android.notepad -v 2000 |
This file contains 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
if (android.os.Build.VERSION.SDK_INT > 15) | |
{ | |
bundle.setAction("android.service.wallpaper.CHANGE_LIVE_WALLPAPER"); | |
bundle.putExtra("android.service.wallpaper.extra.LIVE_WALLPAPER_COMPONENT", new ComponentName(com/loard/ganesha/MyService.getPackage().getName(), com/loard/ganesha/MyService.getCanonicalName())); | |
} else | |
{ | |
bundle.setAction("android.service.wallpaper.LIVE_WALLPAPER_CHOOSER"); | |
} |
This file contains 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
class PInfo { | |
private String appname = ""; | |
private String pname = ""; | |
private String versionName = ""; | |
private int versionCode = 0; | |
private Drawable icon; | |
private void prettyPrint() { | |
Log.v("LOG===> ", appname + "\t" + pname + "\t" + versionName | |
+ "\t" + versionCode); |
This file contains 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
View view = relativeLayout; // Your layout which you want to capture | |
view.measure(View.MeasureSpec.makeMeasureSpec(1200, View.MeasureSpec.UNSPECIFIED), View.MeasureSpec.makeMeasureSpec(1920, View.MeasureSpec.UNSPECIFIED)); | |
//view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight()); | |
view.buildDrawingCache(true); | |
Bitmap bitmap = Bitmap.createBitmap(view.getDrawingCache()); | |
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); | |
bitmap.compress(Bitmap.CompressFormat.PNG,100,bytes); | |
and save bitmap in your desire location |
This file contains 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
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | |
<item name="android:colorPrimary">@color/primary</item> | |
<item name="android:colorPrimaryDark">@color/primary_dark</item> | |
<item name="android:textColorPrimary">@color/primary_text</item> | |
<item name="android:textColorSecondary">@color/secondary_text</item> | |
<item name="android:colorAccent">@color/accent</item> | |
<item name="android:windowBackground">@color/window_background</item> | |
</style> |
This file contains 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
***************** Java ****************** | |
import android.app.Dialog; | |
import android.content.Context; | |
import android.graphics.drawable.AnimationDrawable; | |
import android.view.Gravity; | |
import android.view.View; | |
import android.view.WindowManager; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
This file contains 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
Uri imageUri = Uri.parse("/sdcard/Aa.png"); | |
//Uri imageUri = Uri.parse("/storage/emulated/0/designapp/Aa.png"); | |
Intent intent = new Intent(Intent.ACTION_ATTACH_DATA); | |
intent.setDataAndType(imageUri, "image/*"); | |
intent.putExtra("png", "image/*"); | |
startActivityForResult(Intent.createChooser(intent,"Set AS"), 1000); | |
User for Set Image as wallpaper, Contact Picture and other.... |
This file contains 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.content.Context; | |
import android.graphics.Rect; | |
import android.support.v4.view.ViewCompat; | |
import android.support.v7.widget.RecyclerView; | |
import android.util.Log; | |
import android.view.View; | |
import com.dhl.tiktail.BuildConfig; | |
import java.lang.reflect.Field; |
This file contains 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
/* | |
* Copyright 2015 serso aka se.solovyev | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
OlderNewer