Skip to content

Instantly share code, notes, and snippets.

View trinadhkoya's full-sized avatar
💭
I may be slow to respond.

trinadhkoya trinadhkoya

💭
I may be slow to respond.
View GitHub Profile
Code Structure
activities
Contains all the activities. Classes are all named with Activity at the end. That way, you can immediately know what it is when reading Java code that doesn't have its full package name.
adapters
Contains all the adapters.
@trinadhkoya
trinadhkoya / location-fetch-two-way
Created March 17, 2017 04:42
Better way of getting the user's location in Android
/**
* try to get the 'best' location selected from all providers
*/
private Location getBestLocation() {
Location gpslocation = getLocationByProvider(LocationManager.GPS_PROVIDER);
Location networkLocation =
getLocationByProvider(LocationManager.NETWORK_PROVIDER);
// if we have only one location available, the choice is easy
if (gpslocation == null) {
Log.d(TAG, "No GPS Location available.");
320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).
The Max widths are as follows
@trinadhkoya
trinadhkoya / gist:079a26be709f973250b72d72f8155653
Created December 12, 2016 05:52
generate SHA-1 fingerprint using java keytool On Windows
keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
USERPROFILE -->C:\Users\trina\.android\debug.keystore
a single * in python changes the whole thing
In this example ,i am working with backend server to validate my credentials.unfortunately i got the error like Wrong Credentials.
putting before * makes sense for me for that f****g problem