KNOWLEDGE BASE

Community.

Share and learn. Create something amazing with
the collaboration of our great community.

#175PubSub Android project- facing problem in communication.

hello there, I am using three phones for this application. two of them having API-26, and One having API-25. The problem is whatever I am publishing, it is only notified in only one mobile having API-25, and other two having API-26 does not get any notification. I don't know what I am doing wrong in this. whether I am doing something wrong???? because it works completely fine in One android phone having API-25, need your suggestions...Thanks

Diwakar Deep . Nov. 10, 2018, 10:13 a.m.

0

#174pubsub Android project- error after compiling in my phone

hello, the above project compiled and installed in my samsung galaxy-A5, but facing some problems in running in other android phones having the same API-26, I am having few problems when I click any of the given options. ERRORS- Hype SDK could not be started. Suggestion: Please check your internet connection. Description: The HTTP request to the Hype server failed or Adapter is off check this links-- https://ibb.co/dA64Cq https://ibb.co/da59dV I have tried enabling/disabling wifi, hotspot, bluetooth etc to fix this error still not able to solve this. Thanks.

Diwakar Deep . Nov. 10, 2018, 7:22 a.m.

closed

1

#173Pubsub Android project - Devices not talking with each other

Hello there, newbie question perhaps. I downloaded the "Pubsub Android project" from github, updated the app keys etc., and deployed it on a Google Nexus 6 and a Samsung Tablet SM-T237P. The apps installed fine and can subscribe to the channel. However, when I publish an update, it only shows up on the device from which I have published it. The services show up in each device's subscription. [Link](https://ibb.co/gjf9sq) For some reason, the two devices are not connecting. I have enabled/disabled wi-fi, tried airplane mode etc. Is there something really simple that I am missing? Also, are there any settings that I need to turn on for this. The two devices can see each other when I go to the Bluetooth settings. Thanks

Saurabh G . Nov. 8, 2018, 7:56 p.m.

0

#172Error building the GIT Sample Project for Android

Hello there, I just downloaded the Pubsub Android project, added the Hype SDK and updated the app keys. However, my Android studio is not compiling it. ![Here is the error I am getting](https://ibb.co/jL2MNq "enter image title here") [Link](https://ibb.co/jL2MNq)

Saurabh G . Nov. 8, 2018, 1:05 p.m.

closed

3

#171Android API 26+ startup crash: `java.lang.IllegalStateException: Not allowed to start service Intent`

A very simple Android phone app is frequently failing to start with this exception: ``` 2018-10-24 21:16:51.713 3178-3178/me.komorowski.simpleuiapp E/AndroidRuntime: FATAL EXCEPTION: main Process: me.komorowski.simpleuiapp, PID: 3178 java.lang.RuntimeException: Unable to create application me.komorowski.simpleuiapp.MainApplication: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=me.komorowski.simpleuiapp/com.hypelabs.hype.HypeService }: app is in background uid UidRecord{eec5c47 u0a86 SVC idle change:uncached procs:1 seq(0,0,0)} at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5876) at android.app.ActivityThread.access$1100(ActivityThread.java:199) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=me.komorowski.simpleuiapp/com.hypelabs.hype.HypeService }: app is in background uid UidRecord{eec5c47 u0a86 SVC idle change:uncached procs:1 seq(0,0,0)} at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1577) at android.app.ContextImpl.startService(ContextImpl.java:1532) at android.content.ContextWrapper.startService(ContextWrapper.java:664) at com.hypelabs.hype.au.a(Unknown Source:17) at com.hypelabs.hype.ae.d(Unknown Source:31) at com.hypelabs.hype.Hype.start(Unknown Source:7) at me.komorowski.simpleuiapp.MainApplication.startHype(MainApplication.kt:76) at me.komorowski.simpleuiapp.MainApplication.onCreate(MainApplication.kt:13) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871) at android.app.ActivityThread.access$1100(ActivityThread.java:199)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:193)  at android.app.ActivityThread.main(ActivityThread.java:6669)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858 ``` Details of the API I'm targeting (this is important I think!): ``` compileSdkVersion 28 minSdkVersion 21 targetSdkVersion 28 ``` And here is the source code of the application: [https://pastebin.com/FS1aZzN0](https://pastebin.com/FS1aZzN0) It seems seems to be an API 26+ issue, according to this [Stack Overflow question](https://stackoverflow.com/questions/46445265/android-8-0-java-lang-illegalstateexception-not-allowed-to-start-service-inten). 1. Are you familiar with the problem? 2. Are there any accepted workarounds? Is the [BaseApplication](https://github.com/Hype-Labs/HypeChatDemo.android/blob/e4b51b1a2cf5d3780dfb39a67fc4302c829270bf/app/src/main/java/com/hypelabs/hypechatdemo/BaseApplication.java) class one of them? 3. Is there any timeline for when there will be no workarounds needed? Thanks! Konrad PS: I hope that I'm not posting too much - let me know if these reports are useful to you, and what's the best way to see what are the currently open SDK issues so that I don't post duplicates.

Konrad Komorowski . Oct. 24, 2018, 3:44 p.m.

0

#170"chatty" and power hungry mode (for IoT gateways)

Hey! I succesfully installed Hype on Android Things (Raspberry Pi 3 Model B) and got it to communicate with Android and iOS devices over the BLE transport. The issue is that sometimes it takes a long time to discover other devices, connections are lost, etc. I suspect that there may be BLE parameters to vary (such as frequency of advertising or listening) which affect the reliability and latency of connectivity. I also suspect that these parameters are tuned to find a balance between power consumption and performance. Is there a way to initialize the Hype framework on Android in power hungry mode, to boost performance in case of wall powered devices? Best, Konrad

Konrad Komorowski . Oct. 23, 2018, 5:53 a.m.

2

#169Crash: "Parameter specified as non-null is null" at "com.hypelabs.hype.al.run(Unknown Source:42)"

Hey! The Hype framework on Android crashed on receiving a message with the below stack trace. I suspect that the root cause was that only one node resolved the other. ``` 2018-10-23 11:34:10.407 3909-3944/me.komorowski.androidthingshelloworld E/AndroidRuntime: FATAL EXCEPTION: pool-4-thread-1 Process: me.komorowski.androidthingshelloworld, PID: 3909 java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter instance at me.komorowski.androidthingshelloworld.MainApplication.onHypeMessageReceived(Unknown Source:29) at com.hypelabs.hype.al.run(Unknown Source:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) ``` The setup was the following: **Device 1:** Raspberry Pi 3 Model B, Android Things 1.0.5, i.e. Android 8.1.0, API 27, Hype 2.0.42 **Device 2:** Google Pixel 1, Android 9, API 28, Hype 2.0.42 Device 1 is running a simple hello world + echo + broadcast app (send hello world on resolving an instance, echo received messages and occassionally broadcast a message to all currently resolved instances). It's configured to use just BLE. Device 2 is running `HypeChatDemo.android` configured to use just BLE. I noticed that Device 2 has resolved Device 1 (Device 1 appeared on its chat list). However Device 1 did not resolve Device 2 -- nothing was in the logs and it didn't send a hello world message. When I sent a message from Device 2 to Device 1, the app on Device 1 crashed. Device 1 was running the Hype framework overnight, for about 12 hours at the time of the crash. Is there any more debugging info that I can provide? Is this the best channel to report such issues? Best, Konrad PS: Here are more logs from Device 1, to show what was happening to it for the 12 hours prior to the crash: [https://pastebin.com/raw/kDYJNLhp](https://pastebin.com/raw/kDYJNLhp). C0BC6266774E3C61 is Device 2. C0BC6266E04F5C25 is an iOS device that wasn't in the range when the crash happened.

Konrad Komorowski . Oct. 23, 2018, 5:46 a.m.

1

Are you ready to
build something great?

The Hype SDK creates peer-to-peer secure mesh networks between nearby devices, even without Internet.