Skip to content

rebeccajames/WearHttp

 
 

Repository files navigation

WearHttp

This library provides a means to access the content on the Web easily from AndroidWear.

Android Arsenal

Example

Code in AndroidWear app

new WearGetText(MainActivity.this).get("http://example.com/text.txt", 
  new WearGetText.WearGetCallBack() {
    @Override
    public void onGet(String contents) {
        mTextView.setText(contents);
    }

    @Override
    public void onFail(final Exception e) {
        mTextView.setText(e.getMessage());
    }
});
new WearGetImage(MainActivity.this).get("https://example.com/image.png", 
  new WearGetImage.WearGetCallBack() {
    @Override
    public void onGet(Bitmap image) {
        mImageView.setImageBitmap(image);
    }

    @Override
    public void onFail(final Exception e) {
        mTextView.setText(e.getMessage());
    }
});

AndroidWear screen shot

image

Usage

In Mobile and Wear module build.gradle:
You must be implemented in both the Mobile and Wear

dependencies {
    ...
    compile 'com.kogitune:wear-http:0.0.5'
}

Example Project

Directory

  • mobilesample
  • wearsample

Suggestion

WearHttp can use in WearSharedPreferences and simultaneous.

License

This project is released under the Apache License, Version 2.0.

About

This library provides a means to access the content on the Web easily from AndroidWear. Welcome pull request

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Java 100.0%