Emmet is an protocol based data-transfer for Android Wear
1/ Declare your protocols into interfaces
public interface WearProtocol{
public void sendMyObject(MyObject object);
}
2/ Use Emmet to send data to the Wear
WearProtocol wearProtocol = emmet.createSender(WearProtocol.class);
wearProtocol.sendMyObject(myObject);
3/ Receive the data in Wear
emmet.registerReceiver(WearProtocol.class, new WearProtocol() {
@Override
public void sendMyObject(MyObject object) {
/* Do whatever you want with the object */
}
});
Please take a look to the wiki
Take a look to a fully sample app using Emmet and DaVinci : https://github.com/florent37/Potier
Create a new library module, for example wearprotocol
Import wearprotocol into your wear & smartphone modules
dependencies {
compile project(':wearprotocol')
}
In the module wearprotocol import emmet
dependencies {
compile ("com.github.florent37:emmet:1.0.6@aar"){
transitive=true
}
}
Looking for contributors, feel free to fork !
If you want to learn wear development : http://tutos-android-france.com/developper-une-application-pour-les-montres-android-wear/.
Author: Florent Champigny
<img alt="Follow me on Google+" src="https://raw.githubusercontent.com/florent37/DaVinci/master/mobile/src/main/res/drawable-hdpi/gplus.png" /> <img alt="Follow me on Twitter" src="https://raw.githubusercontent.com/florent37/DaVinci/master/mobile/src/main/res/drawable-hdpi/twitter.png" /> <img alt="Follow me on LinkedIn" src="https://raw.githubusercontent.com/florent37/DaVinci/master/mobile/src/main/res/drawable-hdpi/linkedin.png" />
Copyright 2015 florent37, Inc.
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.