본문 바로가기

개발/Android 오픈소스

[안드로이드] 유용한 라이브러리 - 개발속도를 빠르게 해주는 각종 유틸 모음 AirQuickUtils



안드로이드에서 자주 사용되는 기능들에 대해 좀더 쉽고 편하고 안정적이게 사용할 수 있도록 제공하는 유틸 라이브러리 입니다. 이 라이브러에 포함된 모든 기능들은 안드로이드에서 제공하는 API를 사용하고 있으며, 이를 좀더 직관적이고 손쉽게 사용할 수 있도록 하였습니다.


일부 OS버전별로 분기가 필요한 부분에 대해서도 라이브러리 자체에서 처리를 해주어 개발단계에서 보다 쉽게 개발할 수 있도록 하고 있습니다. 앞으로 확장될 예정이지만 현재는 아래의 종류에 대한 기능을 제공중이며, 앞으로 확장될 예정입니다.


이 글에 포함된 사용법인 일부 기능에 대한 사용법이며 자세한 기능은 문서를 보시거나 댓글로 질문해주세요 :)


포함된 기능

API문서에서 보기(2017.11.03 기준)

  • AirLog
  • AirPrefs
  • AirScreen
  • AirSdcard
  • AirShare
  • AirString
  • AirSystem
  • AirValidation
  • AirWebView
  • AirNetwork(추가예정)
  • AirSecurity
  • AirSnsLogin(별도 라이브러리로 제공 예정)
  • AirAnimation(추가예정)
  • AirDateTime(추가예정)
  • AirImage(추가예정)
  • AirLocation(추가예정)




설정하기

1.사용할 프로젝트의 app.gradle에 라이브러리를 import 합니다.

  allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}
  compile 'com.github.yongbeam:AirQuickUtils:0.0.2'


2. Application 클래스에서 AirQuickUtils를 초기화 합니다.

  AirQuickUtils.init(this);
  // The log is not exposed in debug mode unless you specify. (Required)
  AirQuickUtils.setMode(BuildConfig.DEBUG);
  AirQuickUtils.setTAG("TAG NAME");
* setMode() 는 개발/프로덕션 을 구분하기 위해 사용됩니다. 직접 true/false 를 넣으실 수 있지만 BuildConfig.DEBUG를 넣으시면 배포 단계에서 실수를 예방하실 수 있습니다. AirQuickUtils 은 프로덕션으로 배포될때 자동으로 로그를 남기지 않도록 변경합니다.




사용예시

AirPref.

set SharedPreferences.
  AirQuickUtils.prefs.save("KEY_NAME" , "String Value");
  AirQuickUtils.prefs.save("KEY_NAME" , true);
  AirQuickUtils.prefs.save("KEY_NAME" , 10);
  AirQuickUtils.prefs.save("KEY_NAME" , 10f);
  AirQuickUtils.prefs.save("KEY_NAME" , 10L);

get SharedPreferences.

  AirQuickUtils.prefs.getString("KEY_NAME" , null);
  AirQuickUtils.prefs.getBoolean("KEY_NAME" , false);
  AirQuickUtils.prefs.getInt("KEY_NAME" , 0);
  AirQuickUtils.prefs.getFloat("KEY_NAME" , 0f);
  AirQuickUtils.prefs.getLong("KEY_NAME" , 0L);


AirLog.

  AirQuickUtils.log.d("LOG MESSAGE");


AirWebView.

1. Add AirCommonWebViewActivity into your AndroidManifest.xml

     <!-- AirCommonWebViewActivity -->
     <activity android:name="yongbeom.utils.airquickutils.activity.AirCommonWebViewActivity"
         android:theme="@style/Theme.AppCompat" />

2. Set AirWebViewOption

    AirWebViewOption webViewOption = new AirWebViewOption();
    webViewOption.setUrl("http://www.mowa.kr");
    webViewOption.setTitle("TEST WEB VIEW");
    webViewOption.setShowActionbar(false);
    webViewOption.setShowUrl(false);

3. call startAirCommonWebView

    AirQuickUtils.webview.startAirCommonWebView(webViewOption);


AirSystem. Class AirQuickUtils.system

  AirQuickUtils.system.getDeviceUUID();


AirScreen. Class AirQuickUtils.screen

  AirQuickUtils.screen.getScreenDensity();


AirSdcard. Class AirQuickUtils.sdcard

  AirQuickUtils.sdcard.createTempDir();

라이센스

Copyright 2017 LeeYongBeom

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.




궁금한 사항은 언제든 댓글로 문의주시면 됩니다 :)



github에서 보기