=================
#KJFrameForAndroid Summary

KJFrameForAndroid is also called KJLibrary. It's an Android ORM and IOC framework and includes UILibrary, PluginLibrary, HttpLibrary, BitmapLibrary, DBLibrary. KJFrameForAndroid is designed to wrap complexity of the Android native SDK and keep things simple. However,KJFrameForAndroid is free open source object. Thanks for you follow this KJFrameForAndroid.
- QQ group:257053751(开发者群1),201055521(开发者群2)
- 国内用户请访问git.osc:http://git.oschina.net/kymjs/KJFrameForAndroid
- DL:https://github.com/singwhatiwanna/dynamic-load-apk
- issues https://github.com/kymjs/KJFrameForAndroid/issues
- version log https://github.com/kymjs/KJFrameForAndroid/blob/master/debug_log.txt
Create /binrary/kjlibrary.jar and include as jar dependency to your project.
Include the KJFrameForAndroid project as Library Dependency in your project.
make use of KJFrameForAndroid works on Android 3.0 or higher and need permission in your AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />Did you really try? execute not installed apk file, PluginLibrary can I help you.
you can download pluginDemo project integrating example project learn KJFrameForAndroid.Detail
UILibrary -> Widget function
import in common use widget,for example, can pull ListView/ScrollView; can double click zoom's ImageView.
UILibrary -> Topology function
import a Activity inheritance link.Get topology all function, you can extends org.kymjs.kjframe.KJActivity(KJFragment) for your Activity(Fragment).
public class TabExample extends KJActivity {
@BindView(id = R.id.bottombar_content1, click = true)
public RadioButton mRbtn1;
@BindView(id = R.id.bottombar_content2, click = true)
private RadioButton mRbtn2;
@Override
public void setRootView() {
setContentView(R.layout.aty_tab_example);
}
@Override
protected void initWidget() {
super.initWidget();
mRbtn1.setText("widget clicked listener");
}
@Override
public void widgetClick(View v) {
super.widgetClick(v);
switch (v.getId()) {
case R.id.bottombar_content1:
ViewInject.toast("clicked mRbtn1");
break;
case R.id.bottombar_content2:
ViewInject.toast("clicked mRbtn2");
break;
}
}
}in topology method called queue:
setRootView();
@BindView
initDataFromThread();(asynchronous,can do time consuming)
threadDataInited();(initDataFromThread() executed just call back)
initData();
initWidget();
registerBroadcast();
Can whichever View set image(for ImageView set src;other view set background).
Loading bitmap,never out of memory exception.
defualt make use of memory least recently used + disk least recently used cache image.
before in android 2.3, we used to SoftReference or WeakReference to cache image. However,on the basis of Google
represent, System.gc() more likely recovery to SoftReference or WeakReference.And into android 3.0,image data for cache
in memory,will difficult recovery, have possible crash. BitmapLibrary make use of lru algorithm manager cache called
KJBitmap kjb = KJBitmap.create();
/**
* url can be local sdcard path or internet url;
* view can whichever View set image(for ImageView set src;for View set background).
*/
// local sdcard image
kjb.display(imageView, "file:///storage/sdcard0/1.jpg");
// internet url
kjb.display(textView, http://www.xxx.com/xxx.jpg);
//自定义图片显示大小
kjb.display(view, http://www.xxx.com/xxx.jpg, 80, 80); //width=80,height=80Android has provided two HTTP Clients AndroidHttpClient (Extended from apache HTTPClient) and HttpUrlConnection to make a HTTP Request. You can select which Http client.
// get
kjh.get("http://www.oschina.net/", new HttpCallBack();//like post, so just one example
// post
KJHttp kjh = new KJHttp();
HttpParams params = new HttpParams();
params.put("id", "1");
params.put("name", "kymjs");
kjh.post("http://192.168.1.149/post.php", params, new HttpCallBack() {
@Override
public void onPreStart() {
super.onPreStart();
KJLoger.debug("before start");
}
@Override
public void onSuccess(String t) {
super.onSuccess(t);
ViewInject.longToast("request success");
KJLoger.debug("log:" + t.toString());
}
@Override
public void onFailure(Throwable t, int errorNo, String strMsg) {
super.onFailure(t, errorNo, strMsg);
KJLoger.debug("exception:" + strMsg);
}
@Override
public void onFinish() {
super.onFinish();
KJLoger.debug("request finish. Regardless of success or failure.");
}
}); // on server example
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />
