Kjframeforandroid, also known as Kjlibrary, is an Android quick dev kit. It also encapsulates the framework for bitmap, Http, plug-in module loading operations in Android, making it easier for developers to implement these features and ultimately enable fast and secure and efficient development of apps. Our goal is to accomplish the most complex functions with the least amount of code, with the highest efficiency.
you can get the project source code from here Http://git.oschina.net/kymjs/KJFrameForAndroid
kjframeforandroid references Many of the internationally renowned Android frameworks such as volley, Sync-http, getting started with lower thresholds, more comprehensive HTTP requests, thoughtful bitmap network loading, perfect functionality and unaffected by confusion ...
Many friends are asking, what is the difference between kjframeforandroid and Xutils, Afinal, Thinkandroid, After you have seen the source code of such a framework, you will be very intuitive to find: kjframeforandroid project structure and code more intuitive and easy to understand, project demo and API documentation more complete, more critical is to use more simple and easy to get started. And it doesn't end up being a project that no one else will be maintaining, like other frameworks.
after one months of refactoring, this 2.0 update includes
1, refactor the code logic, improve the overall performance of the framework, improve code readability.
2, optimize the picture cache logic, improve the processing speed of image loading
3. Resolve HTTP request Interrupt Exception 4, perfect resolve breakpoint Download cause deadlock problem
5, rewrite the multi-file upload logic, file image upload more convenient
6, add File Upload server side receive demo, more easily with the background to achieve file data interaction
7, solve the plug-in development library file clutter problem
8. Increase the normalization of activity succession chain
=========================== Each module introduces ======================
Plugin Module
have you ever imagined that you would not install an apk and be called directly by the app? Have you considered using one of the features of the application to be read at any time as a file? Plug-in module can easily help you to implement the APK dynamic loading, let your app call the APK is not installed.
uilibrary Moduleincludes two parts:
The widget control section mainly encapsulates the common UI controls, in order not to make the project jar package too large, we only introduce the controls that are bound to be used in development, such as: Kjlistview that can be pulled up and down, kjscrollview that can be pulled up, Can double-finger zoom double-click to zoom two-finger rotation of the scaleimageview, etc... For more information, please check the project file yourself. What's under the widget package
The Topology topology section contains a control initialization that uses the IOC design idea: UI binding can be annotated, and settings listening, and in both activity and fragment, a single line of code can be used to bind the control and enable click-Listening It also contains layout interfaces that are common in current application development, such as slide-slip effects, efficient bottom tab navigation, and 3D effect switching. At the same time Uilibrary defines the perfect baseactivity and basefragment for the developer, the developer can get all the functions of topology part by manual inheritance.
bitmaplibrary Module
A line of code to implement the network picture loading, any view (ImageView set SRC, normal view set BG) load the picture without consideration of the image loading process of oom and the Android container rapid sliding when the picture dislocation phenomenon, There is no need to consider the oom that appears during the image loading process. The default is to use the memory LRU algorithm + disk LRU algorithm to cache pictures while saving memory consumption by default, the size of the control is taken as the size of the picture to load the picture.
httplibrary Module
can be a line of code to implement the HTTP request, a line of code to implement the file or image upload and download. Kjh.download (URL, params, callback);
kjlibrary defaults to caching data for all HTTP traffic, with a cache time of 5 minutes. This is done not only to save the user's mobile phone traffic, but also to reduce the server pressure
also different from afinal download bug (see here: http://my.oschina.net/kymjs/blog/355944), kjframeforandroid native support file breakpoint download.
dblibrary Module
can be a line of code to the database to make the deletion and check the operation: Kjdb.update (); Kjdb.add ();
contains the ORM framework in Android, and uses a thread pool to manipulate SQLite, and a line of code can be used for additional pruning. Support one-to-many, many-to-one queries.
How to use
1. Copy the jar package kjframeforandroid_v2.x to the/libs directory of your project.
2. View the use of each module help
MVC module
Bitmap loading
HTTP request
Database module
3, more in the actual project to use the demo: Music player love to see the blog client
4. Framework API Documentation: Http://kjframe.github.io Note, kjframeforandroid need to declare the following permissions in Androidmanifest.xml
<uses-permission Android:name= "android.permission.INTERNET" /><uses-permission Android:name= "android.permission.WRITE_EXTERNAL_STORAGE" />
GitHub Project Address:
https://github.com/kymjs/KJFrameForAndroid
osc.git Project Address:
http://git.oschina.net/kymjs/KJFrameForAndroid
Kjframeforandroid 2.0 Framework Use