-
Create new keystore.jks file with comand line (not android studio build menu)
Linux:
keytool -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore keystore.jks
Windows:
"C:\Program Files\Android\Android Studio\jre\bin\keytool.exe" -genkeypair -alias upload -keyalg RSA -keysize 2048 -validity 9125 -keystore "C:\keystore_new.jks"
-
Generate a .pem file from new keystore
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 java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
public class PingIP { | |
public static void runSystemCommand(String command) { | |
try { | |
Process p = Runtime.getRuntime().exec(command); | |
BufferedReader inputStream = new BufferedReader( |
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
Build Gradles | |
=============== | |
//Retrofit | |
compile 'com.squareup.retrofit2:converter-gson:2.3.0' | |
compile 'io.reactivex.rxjava2:rxjava:2.1.6' | |
compile 'io.reactivex.rxjava2:rxandroid:2.0.1' | |
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0' | |
//Retrofit logs | |
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1' |
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
package com.location; | |
import android.annotation.SuppressLint; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.content.Intent; | |
import android.content.IntentSender; | |
import android.location.Location; |
##Getting results from DialogFragments to another Fragment.
When setting up the DialogFragment make a call to Fragment.setTargetFragment()
Then from DialogFragment you can access the main fragment with
Fragment.getTargetFragment()
Use interfaces to provide the required actions to the calling Fragment.
##Example code.
###AddFriendDialogFragment - Calls back to calling fragment.
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.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.RectF; | |
import android.os.Build; | |
import android.text.Layout.Alignment; | |
import android.text.StaticLayout; | |
import android.text.TextPaint; | |
import android.text.method.TransformationMethod; | |
import android.util.AttributeSet; |