forked from florent37/Wear-Emmet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtodo.txt
52 lines (39 loc) · 913 Bytes
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
public interface WearProtocol{
public void sayHello();
public void sayGoodbye(int delay, String text, MyObject object);
}
Smartphone :
WearProtocol protocol = DeLorean.create(WearProtocol.class);
protocol.sayHello();
protocol.sayGoodby(3,"bye",object);
Wear :
DeLorean.implement(WearProtocol.class,new WearProtocol(){
public void sayHello(){
}
public void sayGoodbye(int delay, String text, MyObject object){
}
});
public <T> T create(Class<T> service) {
return (T) Proxy.newProxyInstance(service.getClassLoader(), new Class<?>[] { service },
new RestHandler(getMethodInfoCache(service)));
}
sayHello -> [message]sayHello
sayGoodbye ->
{
"name" : "sayGoodbye",
"params" :
{
"1" : {
"type" : "int"
"value" : delay
},
"2" : {
"type" : "String"
"value" : text
},
"2" : {
"type" : "Serialized"
"value" : object
}
}
}