<?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>Extend the DFU library</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/22600/extend-the-dfu-library</link><description>Hi,
in want to extend the DFU library (Android and iOS) with a function similar to setBinOrHex(). But instead of a filename, i want to give a byte array with the init packet and a 2nd byte array with the application, bootloader and/or softdevice (or</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Jun 2017 07:06:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/22600/extend-the-dfu-library" /><item><title>RE: Extend the DFU library</title><link>https://devzone.nordicsemi.com/thread/88908?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2017 07:06:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1aa4752f-8b1b-4e09-a0f5-75829294638b</guid><dc:creator>AD1170</dc:creator><description>&lt;p&gt;Ok, thank you for the tip. It seems to be the better solution. I have taken a look to the content provider implementation. For now, it is a little bit to complex for me and i have not much time at the moment. But for a future release of the app, this is an option. Or do you have any sample code how this can be done (you mentioned libs the make the implentation easy). I&amp;#39;m not so firm with java. The app is written with Qt (Qml, C++). The DFU Lib is called via JNI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extend the DFU library</title><link>https://devzone.nordicsemi.com/thread/88907?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2017 06:32:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eab3fda-e449-47f9-886a-1eac436edf22</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;As the lib also takes the URI, you may create a Content Provider (there are libs that make it very easy) which will provide bytes on URI, and pass this URI to the lib.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extend the DFU library</title><link>https://devzone.nordicsemi.com/thread/88910?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2017 20:40:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e9cf716-3ae2-4ec8-8f4c-9fe315ccd4b3</guid><dc:creator>AD1170</dc:creator><description>&lt;p&gt;Hi Aleksander!
Sure, it would be easier so store the file temporairly. But for security reasons this is not an option. I have added a function &amp;quot;setZip(byte[] zipBuffer), extended the &amp;quot;start()&amp;quot; - function and &amp;quot;onHandleIntend()&amp;quot; with a additional EXTRA... and take care if the zipBuffer is provided in the intent handler.
Finally, i open the InputStream() in this way:
is = new ArchiveInputStream(new ByteArrayInputStream(zipBuffer), mbrSize, fileType);
So far it works. I know i must merge my functions to a new library version by myelf.
Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extend the DFU library</title><link>https://devzone.nordicsemi.com/thread/88909?ContentTypeID=1</link><pubDate>Thu, 08 Jun 2017 09:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84f497c7-fc0f-4ea9-a8b4-893d43f7d1c9</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi! Isn&amp;#39;t it easier for you to just save the files in the temp folder (no permission required) and provide path to those files?
You may do what you want, but you&amp;#39;d have to override the &lt;a href="https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L866"&gt;github.com/.../DfuBaseService.java&lt;/a&gt; method in your project and read the data on your own. Any later changes/bug fixes to the lib that we provide would have to be manually maintained by you and we highly discourage you to do so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>