Revisions
-
geekygecko revised this gist
May 18, 2015 . 1 changed file with 59 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -9,12 +9,20 @@ adb shell screenrecord /sdcard/video.mp4 adb pull /sdcard/video.mp4 ``` Logcat while two devices connected ```bash adb devices adb -s SA5A330471 logcat | grep --line-buffered Playback ``` Easily input text ```bash adb shell input text yourusername; adb shell input keyevent 66; adb shell input text yourpassword; adb shell input text "Can%swe%sstill%sbe%sfriends" ``` ## Styles ## #### Font family #### @@ -37,4 +45,54 @@ xmlns:android="http://schemas.android.com/apk/res/android" xmlns:fab="http://schemas.android.com/apk/res-auto" // designer tools xmlns:tools="http://schemas.android.com/tools" ``` ## Fragments ## ```java public class LocationFragment extends Fragment { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); } public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.location_fragment, container, false); return view; } public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); } public void onResume() { super.onResume(); } public void onPause() { super.onPause(); } public void onDestroy() { super.onDestroy(); } } ``` Create with parameters ```java public static final String EXTRA_LOCATION = "your.package.LOCATION"; public static final LocationFragment newInstance(Location location) { LocationFragment fragment = new LocationFragment(); Bundle bundle = new Bundle(1); bundle.putSerializable(EXTRA_LOCATION, location); fragment.setArguments(bundle); return fragment; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Location location = (Location)getArguments().getSerializable(EXTRA_LOCATION); } ``` -
geekygecko revised this gist
May 18, 2015 . 1 changed file with 23 additions and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,19 +1,34 @@ # Android Cheat Sheet # ## Developer tips ## Record a video of your app ```bash Developer options -> Check show touches adb shell screenrecord /sdcard/video.mp4 adb pull /sdcard/video.mp4 ``` Logcat two devices ```bash adb devices adb -s SA5A330471 logcat | grep --line-buffered Playback ``` ## Styles ## #### Font family #### ```java android:fontFamily="sans-serif" // roboto regular android:fontFamily="sans-serif-light" // roboto light android:fontFamily="sans-serif-condensed" // roboto condensed android:fontFamily="sans-serif-condensed-light" // roboto condensed light android:fontFamily="sans-serif-thin" // roboto thin (android 4.2) android:fontFamily="sans-serif-medium" // roboto medium (android 5.0) ``` ## XML layouts ## ```java // android -
geekygecko renamed this gist
May 18, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
geekygecko created this gist
May 18, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ # Android Cheat Sheet # ## styles ## ### Font family ### ```java android:fontFamily="sans-serif" // roboto regular android:fontFamily="sans-serif-light" // roboto light android:fontFamily="sans-serif-condensed" // roboto condensed android:fontFamily="sans-serif-condensed-light" // roboto condensed light android:fontFamily="sans-serif-thin" // roboto thin (android 4.2) android:fontFamily="sans-serif-medium" // roboto medium (android 5.0) ``` ## xml layouts ## ```java // android xmlns:android="http://schemas.android.com/apk/res/android" // library extension xmlns:fab="http://schemas.android.com/apk/res-auto" // designer tools xmlns:tools="http://schemas.android.com/tools" ```