Difference between revisions of "MQTT: Android Simple Connect"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) (Created page with " ==Referensi== * https://www.hivemq.com/blog/mqtt-client-library-enyclopedia-paho-android-service/") |
Onnowpurbo (talk | contribs) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | ==setting.gradle== | ||
+ | pluginManagement { | ||
+ | repositories { | ||
+ | gradlePluginPortal() | ||
+ | google() | ||
+ | mavenCentral() | ||
+ | maven { | ||
+ | url "https://repo.eclipse.org/content/repositories/paho-releases/" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | dependencyResolutionManagement { | ||
+ | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) | ||
+ | repositories { | ||
+ | google() | ||
+ | mavenCentral() | ||
+ | maven { | ||
+ | url "https://repo.eclipse.org/content/repositories/paho-releases/" | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | ==build.gradle app== | ||
+ | |||
+ | |||
+ | dependencies { | ||
+ | implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.0.2' exclude module: 'support-v4' | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | ==AndroidManifest.xml== | ||
+ | |||
+ | <?xml version="1.0" encoding="utf-8"?> | ||
+ | <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
+ | package="itts.onno.hms.ittsmqttsimpleconnect"> | ||
+ | |||
+ | <uses-permission android:name="android.permission.WAKE_LOCK" /> | ||
+ | <uses-permission android:name="android.permission.INTERNET" /> | ||
+ | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
+ | <uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
+ | |||
+ | <application | ||
+ | .............. | ||
+ | <service android:name="org.eclipse.paho.android.service.MqttService" > | ||
+ | </service> | ||
+ | </application> | ||
+ | |||
+ | </manifest> | ||
Latest revision as of 05:23, 26 March 2022
setting.gradle
pluginManagement { repositories { gradlePluginPortal() google() mavenCentral() maven { url "https://repo.eclipse.org/content/repositories/paho-releases/" } } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url "https://repo.eclipse.org/content/repositories/paho-releases/" } } }
build.gradle app
dependencies { implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.0.2' exclude module: 'support-v4' }
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="itts.onno.hms.ittsmqttsimpleconnect"> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <application .............. <service android:name="org.eclipse.paho.android.service.MqttService" > </service> </application> </manifest>