Skip to content

Instantly share code, notes, and snippets.

View cinohub's full-sized avatar

Blue cinohub

  • Freelancer
View GitHub Profile
@cinohub
cinohub / gist:4f6e92115151d06f54e9c732b424562a
Created July 24, 2016 17:28
Get list installed app in android
private List<Application> getInstalledAppList() {
List<Application> listApps = new ArrayList<>();
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0);
ResolveInfoComparator resolveInfoComparator = new ResolveInfoComparator(getPackageManager());
Collections.sort(pkgAppsList, resolveInfoComparator);
String[] listPackageChecked = SharedPref.getInstance(getBaseContext()).getString(Constants.LIST_APP, "").split(getApplicationContext()
.getString(R.string.signal));
for (Object object : pkgAppsList) {
@cinohub
cinohub / list.java
Last active July 25, 2016 05:25
Get list installed app
private List<Application> getInstalledAppList() {
List<Application> listApps = new ArrayList<>();
final Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
mainIntent.addCategory(Intent.CATEGORY_LAUNCHER);
final List pkgAppsList = getPackageManager().queryIntentActivities(mainIntent, 0);
// Them vao list
for (Object object : pkgAppsList) {
ResolveInfo info = (ResolveInfo) object;
Drawable icon = getBaseContext().getPackageManager().getApplicationIcon(info.activityInfo.applicationInfo);
String strPackageName = info.activityInfo.applicationInfo.packageName.toString();
@cinohub
cinohub / Application.java
Created July 24, 2016 17:33
Application
public class Application {
private String mName;
private String mPackage;
private Drawable mIcon;
private boolean isChecked;
public boolean isChecked() {
return isChecked;
}
@cinohub
cinohub / sort.java
Created July 24, 2016 17:43
sort by alpha
private class ResolveInfoComparator implements Comparator<ResolveInfo> {
final PackageManager packageManager;
public ResolveInfoComparator(final PackageManager packageManager) {
this.packageManager = packageManager;
}
@Override
public int compare(final ResolveInfo resolveInfo, final ResolveInfo resolveInfo2) {
// Sắp xếp theo thứ tự alphabet
ResolveInfoComparator resolveInfoComparator = new ResolveInfoComparator(getPackageManager());
Collections.sort(pkgAppsList, resolveInfoComparator);
@cinohub
cinohub / h1.html
Last active August 26, 2016 19:37
<h1 >
Welcome to my Copy Copy!
</h1>
<style>
html{
background: url(http://i.imgur.com/51By4oL.jpg) no-repeat center fixed;
background-size: cover;
}
</style>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="1024dp"
android:height="1124dp"
android:viewportWidth="342.0"
android:viewportHeight="460.0">
<path
android:fillColor="#FFF"
android:pathData="M305,232.7L305,405C305,410.5 300.5,415 295,415L47,415C41.5,415 37,410.5 37,405L37,232.8C37.2,232.8 37.3,232.8 37.5,232.8C43.3,232.8 48,228.1 48,222.3C48,216.5 43.3,211.8 37.5,211.8C37.3,211.8 37.2,211.8 37,211.8L37,39C37,33.5 41.5,29 47,29L295,29C300.5,29 305,33.5 305,39L305,211.9C304.5,211.8 304,211.8 303.5,211.8C297.7,211.8 293,216.5 293,222.3C293,228.1 297.7,232.8 303.5,232.8C304,232.8 304.5,232.8 305,232.7Z"/>
</vector>
@cinohub
cinohub / khachhang
Created March 26, 2018 10:47
khachhang
03-26 17:32:30.506 30985-30985/com.globmove.chuhang I/API : POST: http://xevn-api.portalbeanzvn.com/yii/web/client/update-lat-long
03-26 17:32:30.510 30985-31148/com.globmove.chuhang I/API Param:: {"pass_id":"6","lat":"21.0420118","long":"105.7756018"}
03-26 17:33:31.512 30985-30985/com.globmove.chuhang I/API : POST: http://xevn-api.portalbeanzvn.com/yii/web/client/update-lat-long
03-26 17:33:31.516 30985-31143/com.globmove.chuhang I/API Param:: {"pass_id":"6","lat":"21.04202","long":"105.7756021"}
03-26 17:34:32.477 30985-30985/com.globmove.chuhang I/API : POST: http://xevn-api.portalbeanzvn.com/yii/web/client/update-lat-long
03-26 17:34:32.482 30985-31146/com.globmove.chuhang I/API Param:: {"pass_id":"6","lat":"21.0420197","long":"105.7756026"}
03-26 17:35:33.461 30985-30985/com.globmove.chuhang I/API : POST: http://xevn-api.portalbeanzvn.com/yii/web/client/update-lat-long
03-26 17:35:33.463 30985-31145/com.globmove.chuhang I/API Param:: {"pass_id":"6","lat":"21.0420248","long":"105.775614"}
03-26 17:36:34.
@cinohub
cinohub / laixe
Created March 26, 2018 10:52
laixe
03-26 17:50:50.742 29952-29952/com.globmove.bactai I/API : POST: http://xevn-api.portalbeanzvn.com/yii/web/driver/get-order-list
03-26 17:50:50.744 29952-29952/com.globmove.bactai I/API : POST: http://xevn-api.portalbeanzvn.com/yii/web/public/tong-dai
03-26 17:50:50.745 29952-30503/com.globmove.bactai I/ API params :: {"driver_id":"3"}
03-26 17:50:50.746 29952-30505/com.globmove.bactai I/ API params :: {}
03-26 17:50:51.764 29952-29952/com.globmove.bactai I/Google Maps Android API: Google Play services package version: 12221438
03-26 17:50:51.921 29952-29952/com.globmove.bactai I/API : POST: http://xevn-api.portalbeanzvn.com/slim/driver/orders/bidding
03-26 17:50:51.924 29952-30504/com.globmove.bactai I/ API params :: {"driver_id":"3"}
03-26 17:50:51.972 29952-30504/com.globmove.bactai E/Response T: {"order":[{"order_id":"28","status_order":"1","lat_from":"21.038575899999998","lon_from":"105.7715017","addr_from":"H\u1ed3 T\u00f9ng M\u1eadu, C\u1ea7u Gi\u1ea5y, H\u00e0 N\u1ed9i, Vi\u1ec7t Nam","lat_to":"21.020