안드로이드 설치된 패키지 리스트 목록 가져오기

Posted by HULIA(휴리아)
2017. 10. 10. 21:24 프론트엔드/안드로이드
private void showShareAvailableApps() {
final PackageManager packageManager = this.getApplicationContext().getPackageManager();

Intent intent = new Intent(Intent.ACTION_MAIN, null);
intent.addCategory(Intent.CATEGORY_LAUNCHER);

List<ResolveInfo> list = packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);

for (ResolveInfo info : list) {
String appActivity = info.activityInfo.name;
String appPackageName = info.activityInfo.packageName;
String appName = info.loadLabel(packageManager).toString();

// Drawable drawable = info.activityInfo.loadIcon(packageManager);

Log.e("tttttttttttttttttt", "appName : " + appName + ", appActivity : " + appActivity
+ ", appPackageName : " + appPackageName);
}
}

안드로이드 패키지 버젼 가져오는 방법

Posted by HULIA(휴리아)
2017. 10. 10. 21:22 프론트엔드/안드로이드
public static String getAppVersion(Context mContext) {
String packageName = null;
String appVersion = null;
try {
PackageInfo _package;
packageName = mContext.getPackageName();
_package = mContext.getPackageManager().getPackageInfo(packageName, 0);
appVersion = _package.versionName;
} catch (PackageManager.NameNotFoundException e1) {
appVersion = "Unknown";
}
return appVersion;
}

안드로이드 스튜디오에서 IntelliJ에서 git사용하기 최초 설정하는법

Posted by HULIA(휴리아)
2017. 3. 28. 01:23 프론트엔드/안드로이드

1. 윈도우 git 설치

https://git-scm.com


2. 안드로이드나 IntelliJ에서 git 설정을 해줘야 할 수 있음

File -> Settings -> version control -> git

git 설정해줌


3. git서버(gitlab, butbucket, github)에서 repository를 생성하기


4. VCS - Enable Version Control Integration

Select a version control system to associated with the project root : Git으로 선택

프로젝트에서 파일들이 빨간색으로 변하는 것을 확인 


5. VCS - Git - Remotes에 git서버 주소를 넣는다


6. 프로젝트 상단 - Git - Add

파일들이 초록색으로 변경되는 것을 확인


7. 프로젝트 상단 - Git - Commit Directory 

commit and push 선택함(아래에 두가지 일이 한번에 수행)

git commit : local repository에 추가

git push : remote repository에 추가


파일들이 회색으로 변하는 것을 확인 

 

 

 

 

안드로이드 intent 패키지명으로 실행

Posted by HULIA(휴리아)
2016. 7. 16. 15:42 프론트엔드/안드로이드
Intent intent = context.getPackageManager().getLaunchIntentForPackage("ParkageName");
startActivity(intent);