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
/** | |
* Simplest utility to fetch the name of file from full path extracted from {@link FileNameUtils} given under below link | |
* References : https://android.googlesource.com/platform/packages/apps/UnifiedEmail/+/master/src/org/apache/commons/io/FilenameUtils.java | |
*/ | |
public class FileNameUtils { | |
/** | |
* The Unix separator character. | |
*/ |
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
-vm | |
C:\Program Files\Java\jdk1.8.0_25\bin\javaw.exe | |
-startup | |
plugins/org.eclipse.equinox.launcher_1.3.200.v20160318-1642.jar | |
--launcher.library | |
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444 | |
-vmargs | |
-Xmx2G | |
-Xms200m | |
-XX:MaxPermSize=512m |
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.utils.formatter; | |
import java.util.IllegalFormatException; | |
import java.util.concurrent.TimeUnit; | |
import org.apache.commons.lang3.time.DurationFormatUtils; | |
public class TimeFormatter { | |
private static final String DURATION_FORMAT = "%02d:%02d:%02d"; |
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 requests | |
import json | |
payload = {'data': {'name':'Robby', 'dept':'HRD'}, 'to':'<Token-Generated-In-Device>'} | |
url = 'https://fcm.googleapis.com/fcm/send' | |
myheaders = {'Content-Type': 'application/json', 'Authorization': 'key=<YourProjectServerKey>'} | |
data=json.dumps(payload) |
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 urllib2 | |
import json | |
payload = {'data': {'name':'Robby', 'dept':'HRD'},'to':'<Token-Generated-In-Device>'} | |
url = 'https://fcm.googleapis.com/fcm/send' | |
headers = {'Content-Type': 'application/json', 'Authorization': 'key=<YourServerKey>'} | |
# When request body has to be plain text | |
# headers = {'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8', 'Authorization': 'key=<YourServerKey>'} |
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
.classpath | |
.project | |
syntax: glob | |
*.class | |
*.apk | |
*.dex | |
*.ap_ | |
*.suo | |
.metadata\* |
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"?> | |
<resources> | |
<color name="red_50">#fde0dc</color> | |
<color name="red_100">#f9bdbb</color> | |
<color name="red_200">#f69988</color> | |
<color name="red_300">#f36c60</color> | |
<color name="red_400">#e84e40</color> | |
<color name="red_500">#e51c23</color> |
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
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="04e8", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0fce", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="1004", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="17ef", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="8087", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="12d1", MODE="0666", GROUP="plugdev" | |
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" |
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
.gradle | |
/local.properties | |
/.idea/workspace.xml | |
/.idea/libraries | |
.DS_Store | |
/build | |
# Built application files | |
*.apk | |
*.ap_ |
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 is about how to access action bar title for all versions, detecting if marquee is activated for the actionbar title and if it is then customizing the font. | |
This mainly emphasizing on avoiding custom view as long as one can access actionbar title textview this way. | |
Since there is no direct way to customize the title TextView in android, a way is : | |
getResources().getIdentifier(String resId, String resType, String package); | |
So when it comes for actionbar in all versions of android we can access it as : | |
int titleId = 0; | |
if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.HONEYCOMB) |
NewerOlder