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
<uses-feature android:name="android.hardware.usb.host" /> | |
<uses-permission android:name="android.permission.USB_PERMISSION" /> | |
<activity android:name=".activities.MainActivity" | |
android:launchMode="singleTop"> | |
<intent-filter> | |
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> | |
</intent-filter> |
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
git checkout --orphan TEMP_BRANCH | |
# Add all the files: | |
git add -A | |
# Commit the changes: | |
git commit -am "Initial commit" | |
# Delete the old branch: | |
git branch -D 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
public class SelectedFilePath { | |
public static String getPath(final Context context, Uri uri) | |
{ | |
//check here to KITKAT or new version | |
final boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; | |
// DocumentProvider |
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
link : https://fcm.googleapis.com/fcm/send | |
postman | |
Header: | |
Authorization:key=AAAAqOQ4GK4:APA91bH0Fqsc9xfl2qMU8uhqOBSBYX1hFo-2p4m_GZtAzDLcyXhFCOpQO4E8oITOmtxS30IQuEqi3dl31b1uJPJsvlSwpGsnKKbVHbxELK1quQLchXZ9LLo_FuojLuehCVJImg_Sx_Cw | |
Content-Type:application/json | |
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
public static List<Employee> getEmployeeListSortedByName() { | |
final List<Employee> employeeList = getEmployeeList(); | |
Collections.sort(employeeList, new Comparator<Employee>() { | |
@Override | |
public int compare(Employee a1, Employee a2) { | |
return a1.getName().compareTo(a2.getName()); | |
} |
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
public void Animate(View view) | |
{ | |
Display display = getWindowManager().getDefaultDisplay(); | |
Point point=new Point(); | |
display.getSize(point); | |
final int width = point.y; // screen height | |
final float halfW = width/2.0f; | |
//Y orX transactionY or tranX | |
ObjectAnimator lftToRgt = ObjectAnimator.ofFloat( view,"Y",200,0f ) | |
.setDuration(3200); // to animate left to right |
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
<?xml version="1.0" encoding="utf-8"?> | |
<selector xmlns:android="http://schemas.android.com/apk/res/android"> | |
<!-- Non focused states --> | |
<item android:state_selected="false" | |
android:drawable="@drawable/defualttab" /> | |
<!-- Focused states (such as when focused with a d-pad or mouse hover) --> | |
<item android:state_selected="true" |
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
Need Activity for display AlertDialog, because we can't display Dialog from any Service | |
Solution. | |
Create Activity as Dialog Theme and start that Activity from Service. | |
Just need to register you Activity in menifest.xml like as below | |
android:theme="@android:style/Theme.Dialog" |
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
dependency | |
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4' | |
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4' | |
Application | |
public class LeakCanaryApplication extends Application { |
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
org.gradle.daemon=true | |
org.gradle.parallel=true |
NewerOlder