<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cannot get Android-DFU-Library to &amp;quot;start&amp;quot;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44457/cannot-get-android-dfu-library-to-start</link><description>I am trying to use the Android-DFU-Library. I have successfully implemented it in my project (the implementation key in gradle). However, even utilizing the documentation and example programs, I cannot get it to work. (I have made the iOS version work</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Mar 2019 17:30:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44457/cannot-get-android-dfu-library-to-start" /><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174887?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 17:30:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a06d8a87-7204-413b-a5c1-a444b0fbb2a8</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;&lt;span&gt;&amp;quot;if I set the setDisableNotification(true) in the initiator, does this mean I don&amp;#39;t need a notification activity?&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Yes, your right.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174883?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 17:19:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4dc8b3b6-9425-41e5-ac6e-e785f5c78a87</guid><dc:creator>bojennett</dc:creator><description>&lt;p&gt;I think I have something in my UI that caused the device to automatically try to reconnect after the Dfu entered. &amp;nbsp;I removed that and I eventually see that it is running the progress via the dfu progress listener and everything works. &amp;nbsp;I can actually see the change in firmware to the other version.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m sorry you aren&amp;#39;t feeling well. &amp;nbsp;Can you give me one more bit of help? &amp;nbsp;You said &amp;quot;if you disable notifications in the initiator this is not required&amp;quot;. &amp;nbsp;if I set the setDisableNotification(true) in the initiator, does this mean I don&amp;#39;t need a notification activity?&lt;/p&gt;
&lt;p&gt;thank you for all your help. &amp;nbsp;I think I&amp;#39;m getting close.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174882?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 17:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d66045b9-9a9d-48dd-9be2-ec00cc6f47d1</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;First of all, i see this:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;DfuImpl Buttonless service without bond sharing found -&amp;gt; SDK 13 or newer&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you sure you&amp;#39;re using SDK 12?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Secondly, there is 20sec gap before the error 8 is received. Why? Did the device reboot in bootloader mode after the Enter Bl command was sent?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Btw, we can continue on Monday. I got sick and I&amp;#39;m not working tomorrow. Perhaps someone from support will contact sooner.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174880?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 16:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a63c9b75-a5ee-4598-abbd-928b6d9ac7a1</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;&amp;quot;&lt;span&gt;how can I pass that in anywhere?&amp;quot; - just like the dfu library is doing (leave the DfuService to be overridden by final app, or pass it as a parameter. Class type is as good as any other.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you disable notifications in the initiator this is not required. There just won&amp;#39;t be any notification downs by the dfu lib. You will still receive progress with the progress listener. The example (although together with notifications) is in nRF Toolbox.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174879?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 16:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6d79f16-4362-4420-8fd6-35830ceea925</guid><dc:creator>bojennett</dc:creator><description>&lt;p&gt;I went ahead and passed in the activity to my library. &amp;nbsp;I now received the following log output. &amp;nbsp;It looks like it started, but couldn&amp;#39;t enable the Bootloader? &amp;nbsp;The verbose log messages with &amp;quot;waveletDevice&amp;quot; are just messages I dump from the DfuProgressListener&lt;br /&gt;&lt;br /&gt;03-07 08:50:55.199 com.wavelethealth.sdktest 25548 - I DfuBaseService DFU service created. Version: 1.8.1 &lt;br /&gt;03-07 08:50:55.273 com.wavelethealth.sdktest 25548 26284 I DfuBaseService Connecting to the device... &lt;br /&gt;03-07 08:50:55.292 com.wavelethealth.sdktest 25548 25693 I DfuBaseService Connected to GATT server &lt;br /&gt;03-07 08:50:55.296 com.wavelethealth.sdktest 25548 25693 I DfuBaseService Attempting to start service discovery... succeed &lt;br /&gt;03-07 08:50:55.305 com.wavelethealth.sdktest 25548 25693 I DfuBaseService Services discovered &lt;br /&gt;03-07 08:50:55.308 com.wavelethealth.sdktest 25548 26284 I DfuImpl Buttonless service without bond sharing found -&amp;gt; SDK 13 or newer &lt;br /&gt;03-07 08:50:55.312 com.wavelethealth.sdktest 25548 - V waveletDevice onDeviceConnected: DD:4C:77:0C:92:B8 &lt;br /&gt;03-07 08:50:55.312 com.wavelethealth.sdktest 25548 - V waveletDevice onDfuProcessStarting: DD:4C:77:0C:92:B8 &lt;br /&gt;03-07 08:50:56.329 com.wavelethealth.sdktest 25548 26284 I DfuImpl Enabling indications... &lt;br /&gt;03-07 08:50:57.379 com.wavelethealth.sdktest 25548 - V waveletDevice onEnablingDfuMode: DD:4C:77:0C:92:B8 &lt;br /&gt;03-07 08:50:57.411 com.wavelethealth.sdktest 25548 26284 I DfuImpl Sending Enter Bootloader (Op Code = 1) &lt;br /&gt;03-07 08:50:57.449 com.wavelethealth.sdktest 25548 26284 I DfuImpl Response received (Op Code = 1, Status = 1) &lt;br /&gt;03-07 08:51:17.505 com.wavelethealth.sdktest 25548 25563 W DfuBaseService Target device disconnected with status: 8 &lt;br /&gt;03-07 08:51:17.531 com.wavelethealth.sdktest 25548 26284 I DfuBaseService Refreshing result: true &lt;br /&gt;03-07 08:51:17.532 com.wavelethealth.sdktest 25548 26284 I DfuBaseService Cleaning up... &lt;br /&gt;03-07 08:51:17.535 com.wavelethealth.sdktest 25548 - I DfuBaseService Action received: android.bluetooth.device.action.ACL_DISCONNECTED &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174875?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 16:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:190ae933-1c4e-44ea-a402-2e38ef30abbb</guid><dc:creator>bojennett</dc:creator><description>&lt;p&gt;&amp;quot;...&lt;span&gt;or create notifications on your own, based on the progress you will receive, and disable them in the dfu library&amp;quot;&lt;br /&gt;&lt;br /&gt;Can you show me an example of this? &amp;nbsp;This literally doesn&amp;#39;t make sense to me. &amp;nbsp;Because you have a dfuProgressListener and I don&amp;#39;t know why I&amp;#39;m not just tapping into that. &amp;nbsp;Secondly, I don&amp;#39;t even know what you mean by &amp;quot;leave the activity to be specified by the app that will use your&amp;nbsp;lib&amp;quot;. I can&amp;#39;t pass this in as a parameter, because we don&amp;#39;t even create an instance of the &amp;quot;NotificationActivity&amp;quot; class. &amp;nbsp;It&amp;#39;s just the class type... how can I pass that in anywhere?&lt;br /&gt;&lt;br /&gt;All I want is to get stuff on the DFUListener and then pass that to my own callbacks that my library produces. &amp;nbsp;This shouldn&amp;#39;t be so&amp;nbsp;complicated. &amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174705?ContentTypeID=1</link><pubDate>Thu, 07 Mar 2019 07:00:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29734243-dbfb-4269-9ba1-8d119ca2a5ec</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;You may either leave the activity to be specified by the app that will use your lib, or create notifications on your own, based on the progress you will receive, and disable them in the dfu library.&lt;/p&gt;
&lt;p&gt;The activity is required there to specify the target when user clicks the notification to be navigated to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174673?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 22:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7573d393-7196-495d-9996-6ccbd4be6514</guid><dc:creator>bojennett</dc:creator><description>&lt;p&gt;(facepalm). &amp;nbsp;Derp. &amp;nbsp;Forgot to do that. &amp;nbsp;OK, I did it, and it causes the app to crash. &amp;nbsp;Because it said:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;strong&gt;java.lang.NullPointerException: getNotificationTarget() must not return null if notifications are enabled&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;I definitely want notifications on progress, just I don&amp;#39;t have an &amp;quot;activity&amp;quot;, as this is in a library. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174667?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 20:49:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1364130-cb8c-4115-ac51-40b9f04ab3d2</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Did you add your service class to Android Manifest?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174658?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 19:09:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fc232be-f3a0-4633-96a0-db14548341bb</guid><dc:creator>bojennett</dc:creator><description>&lt;p&gt;I did that. &amp;nbsp;Still nothing after calling &amp;quot;start&amp;quot;&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve updated the code to use my new class:&lt;/p&gt;
&lt;pre style="padding-left:30px;"&gt;&lt;strong&gt;public void updateGen2Firmware(Context context, String path) {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   Log.v (TAG, &amp;quot;Starting&amp;quot;);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   final DfuServiceInitiator starter = new DfuServiceInitiator(macAddress).setDeviceName(deviceName).setKeepBond(false);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   starter.setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled(true);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   Log.v (TAG, &amp;quot;Setting zip to: &amp;quot; + path);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   starter.setZip(path);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   Log.v (TAG, &amp;quot;setting up progress listener&amp;quot;);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   DfuServiceListenerHelper.registerProgressListener(context, mDfuProgressListener);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   Log.v (TAG, &amp;quot;calling the &amp;#39;start&amp;#39; of starter&amp;quot;);&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   starter.start(context, NordicDfuService.class);&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;And here is the implementation of that class:&lt;/p&gt;
&lt;pre style="padding-left:30px;"&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;android.app.Activity&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;import &lt;/span&gt;&lt;span&gt;no.nordicsemi.android.dfu.DfuBaseService&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;public class NordicDfuService extends DfuBaseService {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   @Override&lt;br /&gt;   protected Class&amp;lt;? extends Activity&amp;gt; getNotificationTarget() {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      /*&lt;br /&gt;       * As a target activity the NotificationActivity is returned, not the MainActivity. This is because the notification must create a new task:&lt;br /&gt;       *&lt;br /&gt;       * intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);&lt;br /&gt;       *&lt;br /&gt;       * when user press it. Using NotificationActivity we can check whether the new activity is a root activity (that means no other activity was open before)&lt;br /&gt;       * or that there is other activity already open. In the later case the notificationActivity will just be closed. System will restore the previous activity.&lt;br /&gt;       * However if the application has been closed during upload and user click the notification a NotificationActivity will be launched as a root activity.&lt;br /&gt;       * It will create and start the main activity and terminate itself.&lt;br /&gt;       *&lt;br /&gt;       * This method may be used to restore the target activity in case the application was closed or is open. It may also be used to recreate an activity&lt;br /&gt;       * history (see NotificationActivity).&lt;br /&gt;       */&lt;br /&gt;      //return NotificationActivity.class;&lt;br /&gt;      return null;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   }&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;   @Override&lt;br /&gt;   protected boolean isDebug() {&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;      // return BuildConfig.DEBUG;&lt;br /&gt;      return true;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   }&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;It really doesn&amp;#39;t look like it is even starting.&lt;br /&gt;&lt;br /&gt;Note - I am using SDK12, so all the buttonless / bonding stuff should be right. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174655?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 18:37:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db5be09f-eb54-4648-877e-30f0173abf99</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;You may return null and disable notifications, and provide then, if you want, on your own based on the progress listener.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174651?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 18:13:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6781825b-e3ea-4546-baad-83f4c6763f1d</guid><dc:creator>bojennett</dc:creator><description>&lt;p&gt;I&amp;#39;m doing this inside of a library, not as part of an application. &amp;nbsp;&amp;quot;getNotificationTarget()&amp;quot; is defined as follows:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span class="pl-k"&gt;protected&lt;/span&gt; &lt;span class="pl-k"&gt;Class&amp;lt;? extends &lt;span class="pl-smi"&gt;Activity&lt;/span&gt;&amp;gt;&lt;/span&gt; &lt;span class="pl-en"&gt;getNotificationTarget&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;How can I use that when I have no Activity&amp;nbsp;being used in the library?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot get Android-DFU-Library to "start"</title><link>https://devzone.nordicsemi.com/thread/174624?ContentTypeID=1</link><pubDate>Wed, 06 Mar 2019 15:35:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d1de2d3-4124-406d-9009-91f9f8760650</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;You have to extend the DfuBaseService.class with your own class. The base one is abstract and requires few methods to be overridden. Have a look at his example: &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/master/app/src/main/java/no/nordicsemi/android/nrftoolbox/dfu/DfuService.java"&gt;https://github.com/NordicSemiconductor/Android-nRF-Toolbox/blob/master/app/src/main/java/no/nordicsemi/android/nrftoolbox/dfu/DfuService.java&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is explained in the documentation: &lt;a href="https://github.com/NordicSemiconductor/Android-DFU-Library/tree/release/documentation#usage"&gt;github.com/.../documentation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this class you may also modify the notification that will be displayed during DFU. If you don&amp;#39;t want any notification, disable them using the initiator.&lt;/p&gt;
&lt;p&gt;Also, setUnsafeExperimentalButtonlessServiceInSecureDfuEnabled should be used only if your fw is based on SDK 12.x., and setKeepBond only when your device is bonded. The false parameter assumes that after successful dfu the target will loose all the bond information.&lt;/p&gt;
&lt;p&gt;Hope that helped!&lt;/p&gt;
&lt;p&gt;Aleksander&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>