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
How to set JAVA_HOME on Mac OS X | |
$ echo $JAVA_HOME | |
/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home | |
Download JDK 8 from Oracle WebSite. [jdk-8u74-macosx-x64.dmg for Mac]. | |
Double click on jdk-8u74-macosx-x64.dmg and follow the screen instructions. | |
JDK package will have been installed on /Library/Java/JavaVirtualMachines. In my computer, I have both 8u66 and 8u74 JDK package. | |
$ ls -l /Library/Java/JavaVirtualMachines |
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
heroku git:clone -a myapp | |
heroku login | |
//Deploy the app | |
heroku create | |
//Deploy your code | |
git push heroku master |
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
# change file permission | |
sudo chmod 755 'filename' |
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
Reference : https://developer.android.com/studio/write/annotations.html#enum-annotations | |
public class FilterColorDescriptor { | |
public static final String FILTER_BLUE = "blue"; | |
public static final String FILTER_RED = "red"; | |
public static final String FILTER_GRAY = "gray"; | |
public final String filterColor; |
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
Multiple dynamic fields with Retrofit | |
HashMap<String, String> map = new HashMap<>(); | |
map.put("param1", param1); | |
map.put("param2", param2); | |
map.put("param3", param3); | |
@FormUrlEncoded | |
@POST("/endpoint/") | |
Call<BaseResponse> endpoint(@Field("user_name") String userName, @FieldMap HashMap<String, String> hashFields); |
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
# Built application files | |
*.apk | |
*.ap_ | |
# Files for the ART/Dalvik VM | |
*.dex | |
# Java class files | |
*.class |
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
# Html in TextView | |
public static Spanned fromHtml(String html){ | |
Spanned result; | |
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) { | |
result = Html.fromHtml(html,Html.FROM_HTML_MODE_LEGACY); | |
} else { | |
result = Html.fromHtml(html); | |
} | |
return result; | |
} |
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
#image | |
<img src="./images/kotlin-plugin.png" height="240"> | |
<img src="https://github.com/favicon.ico" height="24"> | |
<img src="https://github.com/favicon.ico" height="24" width="48"> | |
<p align="center"><img src="./kotlin.png" height="576"></p> | |
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
//Removed default animation | |
overridePendingTransition(0, 0); |
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
In Terminal: | |
nano ~/.bash_profile | |
Add lines: | |
export ANDROID_HOME=/YOUR_PATH_TO/android-sdk | |
export PATH=$ANDROID_HOME/platform-tools:$PATH | |
export PATH=$ANDROID_HOME/tools:$PATH |