Skip to content

Instantly share code, notes, and snippets.

View vilmarbfilho's full-sized avatar
🤖
Trying make a world a better place

V1lm4r vilmarbfilho

🤖
Trying make a world a better place
View GitHub Profile
@vilmarbfilho
vilmarbfilho / library_buildconfig
Created January 9, 2017 11:13
Fix BuildConfig.DEBUG in module library
answer: http://stackoverflow.com/questions/20176284/buildconfig-debug-always-false-when-building-library-projects-with-gradle
Complete documentation can be found here http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Library-Publication
[LIBRARY - build.gradle]
android {
publishNonDefault true
}
[APP]
#list avd
android list avd
#start avd
emulator -avd name_avd
#Create a dump of alarms
adb shell dumpsys alarm > dump.txt
#Create a dump of activities
adb shell dumpsys activity
[https://xgouchet.fr/android/index.php?article42/launch-intents-using-adb]
# specifying the action and data uri
adb shell am start -a "android.intent.action.VIEW" -d "http://developer.android.com"
# specifying the action, mime type and an extra string
adb shell am start -a "android.intent.action.SEND" --es "android.intent.extra.TEXT" "Hello World" -t "text/plain"
# specifying an explicit component name
adb shell am start -n "com.example.application/.MainActivity"
@vilmarbfilho
vilmarbfilho / permissions.txt
Created October 3, 2016 11:08 — forked from Arinerron/permissions.txt
A list of all Android permissions...
android.permission.REAL_GET_TASKS
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.REMOTE_AUDIO_PLAYBACK
android.permission.REGISTER_WINDOW_MANAGER_LISTENERS
android.permission.INTENT_FILTER_VERIFICATION_AGENT
android.permission.BIND_INCALL_SERVICE
android.permission.WRITE_SETTINGS
android.permission.CONTROL_KEYGUARD
android.permission.CONFIGURE_WIFI_DISPLAY
android.permission.ACCESS_WIMAX_STATE
@vilmarbfilho
vilmarbfilho / gist:2726699434a3b370a2ef8255711444a4
Created June 13, 2016 16:26
Change name APK using gradle
android.applicationVariants.all { variant ->
def appName
if (project.hasProperty("applicationName")) {
appName = applicationName
} else {
appName = parent.name
}
variant.outputs.each { output ->
def newApkName
@vilmarbfilho
vilmarbfilho / gist:b9d73b52a5236188c2f9
Created February 1, 2016 11:50
Life cycle fragment android
public class BaseFragment extends Fragment{
private static final String TAG = "base_fragment";
@Override
public void onAttach(Context context) {
super.onAttach(context);
Log.i(TAG, "onAttach()");
}
@vilmarbfilho
vilmarbfilho / gist:d6cea0ffc22025010d66
Last active February 1, 2016 11:45
Life cycle activity android
public class BaseActivity extends AppCompatActivity{
private static final String TAG = "base_activity";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.i(TAG, "onCreate()");
}
Device Real:
adb forward tcp:4444 localabstract:/adb-hub
adb connect localhost:4444
Emulador:
adb -d forward tcp:5601 tcp:5601
java.util.logging.Logger.getLogger("org.apache.http.wire").setLevel(java.util.logging.Level.FINEST);
java.util.logging.Logger.getLogger("org.apache.http.headers").setLevel(java.util.logging.Level.FINEST);
System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.SimpleLog");
System.setProperty("org.apache.commons.logging.simplelog.showdatetime", "true");
System.setProperty("org.apache.commons.logging.simplelog.log.httpclient.wire", "debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http", "debug");
System.setProperty("org.apache.commons.logging.simplelog.log.org.apache.http.headers", "debug");