• Stars
    star
    108
  • Rank 319,441 (Top 7 %)
  • Language
  • License
    MIT License
  • Created about 10 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

There are many libraries which helps your android development!

android-awesome-libraries

Index

Support

private void displayName(@NonNull String name) {
  // name can not be null
}
private void receiveDrawableRes(@DrawableRes int resId) {
  // resId must be Drawable Resource ID
}
mButton.setOnClickListener((View v) -> {
    // do something here
});
  • icepick - Android Instance State made easy
@Icicle String username; // This will be automatically saved and restored

@Override public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  Icepick.restoreInstanceState(this, savedInstanceState);
}

@Override public void onSaveInstanceState(Bundle outState) {
  super.onSaveInstanceState(outState);
  Icepick.saveInstanceState(this, outState);
}
  • Michelangelo - Layout inflation library for Android based on annotations
@InflateLayout(R.layout.custom_view)
public class MyCustomView extends FrameLayout {

    public MyCustomView(Context context) {
        super(context);
    }

    @AfterInflate
    public void updateTextView() {
        ((TextView) findViewById(R.id.my_text_view)).setText("hey!");
    }
}
@Background
void someBackgroundWork(String aParam, long anotherParam) {
    [...]
}
@UiThread
void doInUiThread(String aParam, long anotherParam) {
    [...]
}
gridView.addHeaderView(View v);
  • HeaderFooterGridView - HeaderFooterGridView supports adding header rows and footer rows to GridView
final HeaderFooterGridView headerFooterGridView = (HeaderFooterGridView) findViewById(R.id.HeaderFooterGridView);
 
HeaderView headerView = new HeaderView(context);
headerFooterGridView.addHeaderView(headerView);
 
FooterView footerView = new FooterView(context);
headerFooterGridView.addFooterView(footerView);

mAdapter = new HeaderFooterGridViewAdapter(this);
headerFooterGridView.setAdapter(mAdapter);

Network

RequestQueue queue = Volley.newRequestQueue(this);
String url = "SOMEURL";

JsonObjectRequest jsObjRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
  @Override
  public void onResponse(JSONObject response) {
    // TODO
  }
}, new Response.ErrorListener() {
  @Override
  public void onErrorResponse(VolleyError error) {
    // TODO
  }
});

queue.add(jsObjRequest);
Ion.with(context)
.load("http://example.com/thing.json")
.asJsonObject()
.setCallback(new FutureCallback<JsonObject>() {
   @Override
    public void onCompleted(Exception e, JsonObject result) {
        // do stuff with the result or error
    }
});
  • okhttp - An HTTP+SPDY client for Android and Java applications
OkHttpClient client = new OkHttpClient();

String run(String url) throws IOException {
  Request request = new Request.Builder()
      .url(url)
      .build();

  Response response = client.newCall(request).execute();
  return response.body().string();
}

REST Client

public interface GitHubService {
  @GET("/users/{user}/repos")
  List<Repo> listRepos(@Path("user") String user);
}

Object Serialization

BagOfPrimitives obj = new BagOfPrimitives();
Gson gson = new Gson();
String json = gson.toJson(obj);  

Database

Category restaurants = new Category();
restaurants.name = "Restaurants";
restaurants.save();
List joes = userDao.queryBuilder()
  .where(Properties.FirstName.eq("Joe"))
  .orderAsc(Properties.LastName)
  .list();

Network Image Handling

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);
// Load image, decode it to Bitmap and display Bitmap in ImageView (or any other view 
//  which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView);
really configurable!
// DON'T COPY THIS CODE TO YOUR PROJECT! This is just example of ALL options using.
// See the sample project how to use ImageLoader correctly.
DisplayImageOptions options = new DisplayImageOptions.Builder()
        .showImageOnLoading(R.drawable.ic_stub) // resource or drawable
        .showImageForEmptyUri(R.drawable.ic_empty) // resource or drawable
        .showImageOnFail(R.drawable.ic_error) // resource or drawable
        .resetViewBeforeLoading(false)  // default
        .delayBeforeLoading(1000)
        .cacheInMemory(false) // default
        .cacheOnDisk(false) // default
        .preProcessor(...)
        .postProcessor(...)
        .extraForDownloader(...)
        .considerExifParams(false) // default
        .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default
        .bitmapConfig(Bitmap.Config.ARGB_8888) // default
        .decodingOptions(...)
        .displayer(new SimpleBitmapDisplayer()) // default
        .handler(new Handler()) // default
        .build();

Glide - An image loading and caching library for Android focused on smooth scrolling

Glide.with(this).load("http://goo.gl/h8qOq7").into(imageView);

Event Pub/Sub

eventBus.post(event);
eventBus.register(this);
public void onEvent(AnyEventType event) {
    // TODO: React to the event!
}
bus.post(new AnswerAvailableEvent(42));
@Subscribe public void answerAvailable(AnswerAvailableEvent event) {
    // TODO: React to the event somehow!
}

Gesture

Utility

  • Bolts - a collection of low-level libraries designed to make developing mobile apps easier
final ParseQuery<ParseObject> query = ParseQuery.getQuery("Student");
query.orderByDescending("gpa");
findAsync(query).onSuccessTask(new Continuation<List<ParseObject>, Task<ParseObject>>() {
  public Task<ParseObject> then(Task<List<ParseObject>> task) throws Exception {
    List<ParseObject> students = task.getResult();
    students.get(0).put("valedictorian", true);
    return saveAsync(students.get(0));
  }
}).onSuccessTask(new Continuation<ParseObject, Task<List<ParseObject>>>() {
  public Task<List<ParseObject>> then(Task<ParseObject> task) throws Exception{
    ParseObject valedictorian = task.getResult();
    return findAsync(query);
  }
}).onSuccessTask(new Continuation<List<ParseObject>, Task<ParseObject>>() {
  public Task<ParseObject> then(Task<List<ParseObject>> task) throws Exception {
    List<ParseObject> students = task.getResult();
    students.get(1).put("salutatorian", true);
    return saveAsync(students.get(1));
  }
}).onSuccess(new Continuation<ParseObject, Void>() {
  public Void then(Task<ParseObject> task) throws Exception {
    // Everything is done!
    return null;
  }
});
Router.sharedRouter().map("users/:id", UserActivity.class);
Router.sharedRouter().map("users/new/:name/:zip", NewUserActivity.class);
Router.sharedRouter().open("users/16");
Router.sharedRouter().open("users/new/Clay/94303");
  • android-intents - A collection of well-known Android intents for most common actions
Intent intent = IntentUtils.sendEmail(to, subject, body);
startActivity(Intent.createChooser(intent, "TEST"));
  • GAlette - Tracking events with Google Analytics by annotations
@SendEvent(category = "HelloWorld", action = "sayHello", label="%1$s")
String sayHello (String name) {
  return format("Hello, %s.", name);
}
  • Paraphrase - compile-safe format string builders.
<string name="greeting">Hello, {other_name}! My name is {my_name}.</string>
CharSequence greeting = Phrase.greeting()
    .other_name("GitHub user")
    .my_name("Jake Wharton")
    .build(this);
  • esperandro - Easy SharedPreference Engine foR ANDROid
String superFancyPreference = preferences.superFancyPreferenceKey()
preferences.superFancyPreferenceKey(superFancyPreference)
public void onSendClick() {
    final String status = editText.getText().toString();
    if(status.trim().length() > 0) {
      jobManager.addJobInBackground(new PostTweetJob(status));
      editText.setText("");
    }
}
@Required(order = 1)
@Email(order = 2)
private EditText emailEditText;

@Password(order = 3)
@TextRule(order = 4, minLength = 6, message = "Enter at least 6 characters.")
private EditText passwordEditText;

@ConfirmPassword(order = 5)
private EditText confirmPasswordEditText;

@Checked(order = 6, message = "You must agree to the terms.")
private CheckBox iAgreeCheckBox;
MyObject myObject = new MyObject("foo");
cacheManager.put("myKey", myObject);
mGPUImage = new GPUImage(this);
mGPUImage.setGLSurfaceView((GLSurfaceView) findViewById(R.id.surfaceView));
mGPUImage.setImage(imageUri); // this loads image on the current thread, should be run in a thread
mGPUImage.setFilter(new GPUImageSepiaFilter());
  • Amalgam - Common codes for Android
ToastUtils.showOnUiThread(activity, "SOMESTRING", Toast.LENGTH_SHORT);
isMainThread() // Check if current thread is the main thread.
checkout.start();
// you only need this if this activity starts purchase process
checkout.createPurchaseFlow(new PurchaseListener());
// you only need this if this activity needs information about purchases/SKUs
inventory = checkout.loadInventory();
inventory.whenLoaded(new InventoryLoadedListener())
new AsyncJob.AsyncJobBuilder<Boolean>()
        .doInBackground(new AsyncJob.AsyncAction<Boolean>() {
            @Override
            public Boolean doAsync() {
                // Do some background work
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                return true;
            }
        })
        .doWhenFinished(new AsyncJob.AsyncResultAction<Boolean>() {
            @Override
            public void onResult(Boolean result) {
                Toast.makeText(context, "Result was: " + result, Toast.LENGTH_SHORT).show();
        }
}).create().start();

Cloud Handling

  • Driven - A unified API calls for different cloud storage providers
StorageProvider provider = new Dropbox();
provider.authenticate(credentials);

// list all files in the root
provider.listAsync(new Task<List<DrivenFile>>(){
  public void onComplete(List<DrivenFile> files){
    ...
  }
});

Social Network Handling

mSocialNetworkManager = (SocialNetworkManager) getFragmentManager().findFragmentByTag(SOCIAL_NETWORK_TAG);

if (mSocialNetworkManager == null) {
    mSocialNetworkManager = SocialNetworkManager.Builder.from(getActivity())
            .twitter(<< TWITTER  API TOKEN  >>, << TWITTER  API SECRET  >>)
            .linkedIn(<< LINKED_IN  API TOKEN  >>, << LINKED_IN API TOKEN  >>, "r_basicprofile+rw_nus+r_network+w_messages")
            .facebook()
            .googlePlus()
            .build();
    getFragmentManager().beginTransaction().add(mSocialNetworkManager, SOCIAL_NETWORK_TAG).commit();
}

DI

@InjectView(R.id.user) EditText username;
@InjectView(R.id.pass) EditText password;

@OnClick(R.id.submit) void submit() {
  // TODO call server...
}
@Inject
Thermosiphon(Heater heater) {
  this.heater = heater;
}

View Model Binding

public StringObservable message = new StringObservable();
...
message.set("Hello MVVM!"); // will change the model and view

UI

  • PhotoView - ImageView for Android that supports zooming, by various touch gestures.

AdapterViewAnimator animator = new AdapterViewAnimator(adapterView);
data.add(item);
adapter.notifyDataSetChanged();
animator.animate();

Album handling

  • RoboGuice

Rx

Subscription sub = Observable.from(1, 2, 3, 4, 5)
    .subscribeOn(Schedulers.newThread())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe(observer);

Promise

Deferred deferred = new DeferredObject();
Promise promise = deferred.promise();
promise.done(new DoneCallback() {
  public void onDone(Object result) {
    ...
  }
}).fail(new FailCallback() {
  public void onFail(Object rejection) {
    ...
  }
}).progress(new ProgressCallback() {
  public void onProgress(Object progress) {
    ...
  }
}).always(new AlwaysCallback() {
  public void onAlways(State state, Object result, Object rejection) {
    ...
  }
});

Security

  • Conceal - Fast cryptographic operations for Android by Facebook

Debug Utility

@DebugLog
public String getName(String first, String last) {
  SystemClock.sleep(15); // Don't ever really do this!
  return first + " " + last;
}

  • dspec - An easy way to draw UI specs on top of your Android UI

Gradle Plugin

Testing

Unit

def "should display hello text"() {
    given:
    def textView = new TextView(Robolectric.application)

    and:
    def hello = "Hello"

    when:
    textView.setText(hello)

    then:
    textView.getText() == hello
}
        

Assert

assertThat(frodo.getName()).isEqualTo("Frodo");
assertThat(frodo).isNotEqualTo(sauron)
                 .isIn(fellowshipOfTheRing);
assertThat(sauron).isNotIn(fellowshipOfTheRing);

Fixture

Factory.define(
        // This will guess the User class
        new Definition(User.class) {
            @Override
            public Bundle set(Bundle attrs) {
                attrs.putString("name", "John");
                attrs.putBoolean("admin", false);
                return attrs;
            }
        // This will use the User class (Adming would have been guessed)
        }, new Definition(User.class, "admin") {
            @Override
            public Bundle set(Bundle attrs) {
                attrs.putString("name", "Admin");
                attrs.putBoolean("admin", true);
                return attrs;
            }
        });

Mock

LinkedList mockedList = mock(LinkedList.class);
when(mockedList.get(0)).thenReturn("first");
when(mockedList.get(1)).thenThrow(new RuntimeException());

UI Test

public void testSayHello() {
  onView(withId(R.id.name_field))
    .perform(typeText("Steve"));
  onView(withId(R.id.greet_button))
    .perform(click());
  onView(withText("Hello Steve!"))
    .check(matches(isDisplayed()));
}

Others

buck - A high-performance Android & Java build tool

Documentation

doclava

Contribution

Just fork & edit & send pull-request on GitHub!

####Policy

  1. Official Website over GitHub Repository for links.
  2. Should put codes which reflects the library.
  3. For UI libraries, put demonstorations (AniGIF, PNG, Movies).

And I am considering to ...

  1. Put reference links for each libraries.
  2. Separate pages for each categories.
  3. Separate UI categories.

####Maintainer

kaiinui (https://github.com/kaiinui)

####and...

I am building a website to browse awesome libraries! https://github.com/kaiinui/droidgems

More Repositories

1

UIColor-uiGradientsAdditions

[iOS] Beautiful colors from uiGradients
Objective-C
329
star
2

KIChameleonView

[iOS] A magical image view! Can be a movie, or an anim gif, or normal png, jpgs.
Objective-C
269
star
3

KIProgressView

[iOS] Medium, YouTube-like Progress View!
Objective-C
148
star
4

KIInPlaceEdit

[iOS] In-place editing for UILabel
Objective-C
121
star
5

Swift-UICollectionView-AFNetworking

Sample Swift Project using UICollectionView + AFNetworking Image and DAPagesContainer
Swift
34
star
6

note

My notes.
22
star
7

FastQR

[iOS] Integrate QR reading feature easily.
Objective-C
18
star
8

middleman-inliner

Provides a helper to inline JS/CSS in Middleman for performance.
Ruby
18
star
9

UIGestureRecognizer-RACExtension

Handle gesture events as ReactiveCocoa signals!
Objective-C
10
star
10

Swift-UICollectionView-WebP

UICollectionView + WebP w/SDWebImage
C
10
star
11

NSMutableData-MultipartFormDataAdditions

Easily build multipart/form-data -formatted data. (which used to post an image.)
Objective-C
7
star
12

KILogInject

[iOS] NSLog() any method without writing NSLog()!
Objective-C
6
star
13

Reachability-RACExtensions

Reachability with ReactiveCocoa!
Objective-C
6
star
14

lambda_kit

A set of helpers (.d.ts, handler driver..) for AWS Lambda development.
JavaScript
6
star
15

ios-awesome-libraries

Also in iOS, there are many awesome libraries!
5
star
16

footprint.js

Buzzfeed's "Pound" re-implementation.
JavaScript
5
star
17

SmoothWebView

Native-like behavior for WKWebView
Swift
4
star
18

cocproxy

A proxy which can stub certain URL to a local file.
Ruby
4
star
19

RemoteConfig

[iOS] Easy remote configuration with Google Spreadsheet.
Objective-C
4
star
20

jsonschema-schema.org

schema.org glossary in JSON Schema
3
star
21

droidgems

An awesome libraries for Android development.
CSS
3
star
22

rbbigquery

[WIP] A Ruby BigQuery client.
Ruby
3
star
23

incam

[iOS] Inline Camera UI. You might not need to open a modal to take a picture.
Objective-C
3
star
24

rbscreenshot

Take a screenshot in one line.
Ruby
2
star
25

jc

peco-like interactive JSON processing.
Go
2
star
26

PushablePusher

PushablePusher adds feature to push events from clients to libPusher.
Objective-C
2
star
27

tweet_collector

Collect tweets.
Ruby
2
star
28

CookieSync

Synchronize cookie without blocking UI using transparent SFSafariViewController
Objective-C
2
star
29

i18nfactory

i18nfactory
1
star
30

TodoFlux

experimental flux todo app
Objective-C
1
star
31

CameraRollCompat-iOS8

[DEPRECATED] Bringing Camera Roll to iOS8, where Camera Roll had been thrown away by Apple in iOS8 :/
Objective-C
1
star
32

QR-ios

QR scanner report.
1
star
33

alice-is-my-wife

An android app to manage my sleep cycle.
1
star
34

AIRLocalizedString

Update i18n texts without compelling users to update the App.
1
star
35

Sample-Annotation-AspectJ

A sample of annotation and AspectJ.
Java
1
star
36

Flux-iOS

[iOS] Fundamental Classes for Flux Architecture on iOS
1
star
37

build-jsonschema-schema.org

schema.org glossary in JSON Schema.
Ruby
1
star
38

template-spring-boot-gae

A bootstrap template for Spring Boot on Google App Engine.
Java
1
star
39

QR-android

QR scanner report for Android
Java
1
star
40

api_design-resources

A list of resources to design good API.
1
star
41

ios-articles

Pragmatic iOS Development knowledges
1
star
42

CloudFlow

[WIP] SQS Powered multi-instance coding made easy.
Ruby
1
star
43

java-modern-libraries

A list of modern Java libraries. (Compiling)
1
star
44

ios-architecture-goodies

Architecturing iOS Apps
1
star
45

WebPushWithPayload

An example project that perform service workers push with variable title, body, icon, url.
JavaScript
1
star