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.Manifest; | |
import android.animation.Keyframe; | |
import android.animation.ObjectAnimator; | |
import android.animation.PropertyValuesHolder; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.content.res.Configuration; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; |
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.stuartsapps.hotspotz.utils; | |
import android.app.NotificationChannel; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.graphics.Color; | |
import android.provider.Settings; | |
import android.support.v4.app.NotificationCompat; |
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
interface UserService { | |
@GET("/") | |
Call<ResponseBody> callApi(); | |
} |
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
// This way will trust all certificates. It's not the best way to do, but it's the easiest way to do, especially if you want to trust a self-signed certificate. | |
package com.dhims.myapplication; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.util.Log; | |
import com.loopj.android.http.AsyncHttpClient; |
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.content.Context; | |
import android.content.res.AssetManager; | |
import android.util.Log; | |
import java.io.InputStream; | |
import java.security.KeyStore; | |
import java.security.SecureRandom; | |
import java.security.cert.Certificate; | |
import java.security.cert.CertificateFactory; | |
import java.security.cert.X509Certificate; |
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.content.Context; | |
import android.util.Log; | |
import com.loopj.android.http.AsyncHttpClient; | |
import com.loopj.android.http.AsyncHttpResponseHandler; | |
import com.loopj.android.http.RequestParams; | |
import cz.msebera.android.httpclient.entity.StringEntity; | |
import io.influents.InfluentsPlatform.util.Constant; |
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
**Centralize the support libraries dependencies in gradle** | |
Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries. | |
A very good way is to separate gradle build files, defining something like: | |
``` | |
root | |
--gradleScript | |
----dependencies.gradle |
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.app.Activity; | |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.view.View; | |
import android.view.inputmethod.InputMethodManager; | |
public class KeyboardUtils { | |
public static void hideKeyboard(Activity activity) { | |
View view = activity.findViewById(android.R.id.content); |
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.dhims.androidutils; | |
import android.Manifest; | |
import android.app.Activity; | |
import android.app.ActivityManager; | |
import android.content.Context; | |
import android.content.pm.PackageManager; | |
import android.content.res.Resources; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; |
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.dhims.androidutils; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.preference.PreferenceManager; | |
import android.provider.Settings; | |
import android.support.v4.app.Fragment; |
NewerOlder