{"action":"created","issue":{"url":"https://api.github.com/repos/florent37/Emmet/issues/2","labels_url":"https://api.github.com/repos/florent37/Emmet/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/florent37/Emmet/issues/2/comments","events_url":"https://api.github.com/repos/florent37/Emmet/issues/2/events","html_url":"https://github.com/florent37/Emmet/issues/2","id":72872547,"number":2,"title":"log: emmet end error","user":{"login":"croccio","id":3746525,"avatar_url":"https://avatars.githubusercontent.com/u/3746525?v=3","gravatar_id":"","url":"https://api.github.com/users/croccio","html_url":"https://github.com/croccio","followers_url":"https://api.github.com/users/croccio/followers","following_url":"https://api.github.com/users/croccio/following{/other_user}","gists_url":"https://api.github.com/users/croccio/gists{/gist_id}","starred_url":"https://api.github.com/users/croccio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/croccio/subscriptions","organizations_url":"https://api.github.com/users/croccio/orgs","repos_url":"https://api.github.com/users/croccio/repos","events_url":"https://api.github.com/users/croccio/events{/privacy}","received_events_url":"https://api.github.com/users/croccio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-03T22:02:14Z","updated_at":"2015-05-04T14:48:48Z","closed_at":null,"body":"i've implemented this library in my app. when i send request from smart watch to smartphone no problem. but when i send response from smartphone to android wear in log i see \r\n\r\n        05-03 23:55:38.719  19540-19540/com.paybay.qui D/Emmet﹕ send error\r\n\r\ni haven't put that log in my app, so i think it is your log. can you help me to identify that \"error\"? here you are my impl:\r\n\r\n######ANDROID WEAR\r\n\r\n    public class QUIWearActivity extends Activity implements WearProtocol {\r\n\r\n    protected Emmet emmet = new Emmet();\r\n    protected SmartphoneProtocol smartphoneProtocol;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        emmet.onCreate(this);\r\n\r\n        smartphoneProtocol = emmet.createSender(SmartphoneProtocol.class);\r\n        emmet.registerReceiver(WearProtocol.class, this);\r\n\r\n    }\r\n\r\n    @Override\r\n    protected void onDestroy() {\r\n        super.onDestroy();\r\n        emmet.onDestroy();\r\n    }\r\n\r\n    @Override\r\n    public void responseForCouponRequest(ResponseForCoupon responseForCoupon) {\r\n        Toast.makeText(this, \"ooooops\", Toast.LENGTH_LONG).show();\r\n    }\r\n    }\r\n\r\n\r\n\r\npublic class CouponActivity extends QUIWearActivity {\r\n    \r\n    \r\n        @Override\r\n        protected void onCreate(Bundle savedInstanceState) {\r\n            super.onCreate(savedInstanceState);\r\n            setContentView(R.layout.activity_coupon);\r\n    \r\n    \r\n            smartphoneProtocol.askForCoupon();\r\n    \r\n            Toast.makeText(this, \"ask\", Toast.LENGTH_LONG).show();\r\n    \r\n            final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);\r\n            stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {\r\n                @Override\r\n                public void onLayoutInflated(WatchViewStub stub) {\r\n    \r\n    \r\n                }\r\n            });\r\n        }\r\n    \r\n        @Override\r\n        public void responseForCouponRequest(ResponseForCoupon responseForCoupon) {\r\n            Toast.makeText(this, \"responseForCouponRequest\", Toast.LENGTH_LONG).show();\r\n        }\r\n    }\r\n\r\n\r\n\r\n###### SMARTPHONE\r\npublic class WearService extends EmmetWearableListenerService implements SmartphoneProtocol {\r\n    \r\n        private final static String TAG = WearService.class.getCanonicalName();\r\n    \r\n        private Emmet emmet;\r\n    \r\n        private WearProtocol sender;\r\n    \r\n        @Override\r\n        public void onCreate() {\r\n            super.onCreate();\r\n            getEmmet().registerReceiver(SmartphoneProtocol.class, this);\r\n            sender = getEmmet().createSender(WearProtocol.class);\r\n            Toast.makeText(WearService.this, \"onCreate\", Toast.LENGTH_LONG).show();\r\n        }\r\n    \r\n        @Override\r\n        public int onStartCommand(Intent intent, int flags, int startid) {\r\n            return START_STICKY;\r\n        }\r\n    \r\n        @Override\r\n        public void askForCoupon() {\r\n    \r\n            Toast.makeText(this, \"askForCoupon\", Toast.LENGTH_LONG).show();\r\n    \r\n            verifyUser(new UserVerification() {\r\n                @Override\r\n                public void userVerification(Verification status) {\r\n                    final ResponseForCoupon responseForCoupon = new ResponseForCoupon();\r\n                    switch (status) {\r\n                        case NOT_ACTIVATED:\r\n                            Toast.makeText(WearService.this, \"NOT_ACTIVATED\", Toast.LENGTH_LONG).show();\r\n                            responseForCoupon.setResponseType(QUIWearResponseType.USER_NOT_ACTIVATED);\r\n                            sender.responseForCouponRequest(responseForCoupon);\r\n                            break;\r\n                        case VALID:\r\n                            Toast.makeText(WearService.this, \"VALID\", Toast.LENGTH_LONG).show();\r\n    \r\n                            QuiApi.services().getUserCoupons(new IQuiUserCouponsCallback() {\r\n                                @Override\r\n                                public void onGetCouponsSuccess(List<QUICoupon> coupons) {\r\n                                    Toast.makeText(WearService.this, \"onGetCouponsSuccess\", Toast.LENGTH_LONG).show();\r\n                                    responseForCoupon.setResponseType(QUIWearResponseType.OK);\r\n                                    responseForCoupon.setCouponList(coupons);\r\n                                    sender.responseForCouponRequest(responseForCoupon);\r\n                                }\r\n    \r\n                                @Override\r\n                                public void onGetCouponsError(List<QUICoupon> coupons, RetrofitError error) {\r\n                                    Toast.makeText(WearService.this, \"onGetCouponsError\", Toast.LENGTH_LONG).show();\r\n                                    responseForCoupon.setResponseType(QUIWearResponseType.ERROR);\r\n                                    responseForCoupon.setCouponList(coupons);\r\n                                    sender.responseForCouponRequest(responseForCoupon);\r\n                                }\r\n    \r\n                                @Override\r\n                                public void onGetChachedCoupons(List<QUICoupon> coupons) {\r\n                                    Toast.makeText(WearService.this, \"onGetChachedCoupons\", Toast.LENGTH_LONG).show();\r\n                                    responseForCoupon.setResponseType(QUIWearResponseType.ERROR);\r\n                                    responseForCoupon.setCouponList(coupons);\r\n                                    sender.responseForCouponRequest(responseForCoupon);\r\n                                }\r\n    \r\n                                @Override\r\n                                public void onUserNotLogged() {\r\n                                    Toast.makeText(WearService.this, \"onUserNotLogged\", Toast.LENGTH_LONG).show();\r\n                                    responseForCoupon.setResponseType(QUIWearResponseType.USER_NOT_LOGGED);\r\n                                    sender.responseForCouponRequest(responseForCoupon);\r\n                                }\r\n                            });\r\n                            break;\r\n                        case UNDEFINED:\r\n                        case INVALID:\r\n                            Toast.makeText(WearService.this, \"INVALID\", Toast.LENGTH_LONG).show();\r\n                            responseForCoupon.setResponseType(QUIWearResponseType.USER_NOT_LOGGED);\r\n                            sender.responseForCouponRequest(responseForCoupon);\r\n                            break;\r\n                    }\r\n                }\r\n            });\r\n        }\r\n    }\r\n\r\n\r\n\r\n\r\n#######PROTOCOL\r\n\r\npublic interface WearProtocol {\r\n    \r\n        public void responseForCouponRequest(ResponseForCoupon responseForCoupon);\r\n    \r\n    }\r\n\r\n\r\n\r\n\r\npublic interface SmartphoneProtocol {\r\n\r\n    public void askForCoupon();\r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n    @Parcel\r\n    public class ResponseForCoupon {\r\n    \r\n        QUIWearResponseType responseType;\r\n        List<QUICoupon> couponList;\r\n    \r\n        public QUIWearResponseType getResponseType() {\r\n            return responseType;\r\n        }\r\n    \r\n        public void setResponseType(QUIWearResponseType responseType) {\r\n            this.responseType = responseType;\r\n        }\r\n    \r\n        public List<QUICoupon> getCouponList() {\r\n            return couponList;\r\n        }\r\n    \r\n        public void setCouponList(List<QUICoupon> couponList) {\r\n            this.couponList = couponList;\r\n        }\r\n    \r\n        @Override\r\n        public String toString() {\r\n            return \"ResponseForCoupon{\" +\r\n                    \"responseType=\" + responseType +\r\n                    \", couponList=\" + couponList +\r\n                    '}';\r\n        }\r\n    }\r\n\r\n\r\n\r\n\r\n\r\n    @Parcel\r\n    public enum QUIWearResponseType {\r\n    \r\n        OK(\"OK\"), USER_NOT_ACTIVATED(\"USER_NOT_ACTIVATED\"), USER_NOT_LOGGED(\"USER_NOT_LOGGED\"), ERROR(\"ERROR\");\r\n    \r\n        String code;\r\n    \r\n        QUIWearResponseType(String code){\r\n            this.code=code;\r\n        }\r\n    \r\n        public String getCode() {\r\n            return code;\r\n        }\r\n    \r\n        public static QUIWearResponseType getEnumByCode(String code) {\r\n            for (QUIWearResponseType value : QUIWearResponseType.values()) {\r\n                if (value.getCode().equals(code)) {\r\n                    return value;\r\n                }\r\n            }\r\n            return null;\r\n        }\r\n    \r\n    }\r\n\r\n\r\n\r\nQUICoupon model is a parcelable. to create parcel i use this lib https://github.com/johncarl81/parceler"},"comment":{"url":"https://api.github.com/repos/florent37/Emmet/issues/comments/98737384","html_url":"https://github.com/florent37/Emmet/issues/2#issuecomment-98737384","issue_url":"https://api.github.com/repos/florent37/Emmet/issues/2","id":98737384,"user":{"login":"croccio","id":3746525,"avatar_url":"https://avatars.githubusercontent.com/u/3746525?v=3","gravatar_id":"","url":"https://api.github.com/users/croccio","html_url":"https://github.com/croccio","followers_url":"https://api.github.com/users/croccio/followers","following_url":"https://api.github.com/users/croccio/following{/other_user}","gists_url":"https://api.github.com/users/croccio/gists{/gist_id}","starred_url":"https://api.github.com/users/croccio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/croccio/subscriptions","organizations_url":"https://api.github.com/users/croccio/orgs","repos_url":"https://api.github.com/users/croccio/repos","events_url":"https://api.github.com/users/croccio/events{/privacy}","received_events_url":"https://api.github.com/users/croccio/received_events","type":"User","site_admin":false},"created_at":"2015-05-04T14:48:47Z","updated_at":"2015-05-04T14:48:47Z","body":"i use classes without enums but with another custom object as property. i can use only simple object with \"standard\" object as object in sample"}}