<div dir="ltr">Hi,<div><br></div><div>I followed up the work started by Wojciech and made decoupled Android fh-sync-android working.<br><br>Changes done:<br>1) Network calls are not static, but done through<font face="monospace, monospace"> NetworkClient</font> is now interface, with <font face="monospace, monospace">NetworkClientImpl</font> having implementation with OkHttp Android.</div><div>2) Dataset storage is written against <font face="monospace, monospace">FileStorage </font><font face="arial, helvetica, sans-serif">with implementation FileStorageImpl that uses internal Android storage in files (as was in old sync)<br></font>3) Client unique Id generator was added in <font face="monospace, monospace">ClientIdGenerator </font><font face="arial, helvetica, sans-serif">an </font><span style="font-family:monospace,monospace">ClientIdGeneratorImpl, </span><font face="arial, helvetica, sans-serif">this is needed by cloud app to properly sync (done the same way as in old sync)</font></div><div><span style="font-family:arial,helvetica,sans-serif">4) </span><font face="monospace, monospace">FHSyncListener</font><span style="font-family:arial,helvetica,sans-serif"> and  </span><font face="monospace, monospace">FHSyncConfig </font><font face="arial, helvetica, sans-serif">improved, with new initialization for Android apps<br><br>For Android initialization it's now needed to use </font><span style="color:rgb(111,66,193);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">Sync.</span><span class="gmail-pl-en" style="box-sizing:border-box;color:rgb(111,66,193);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">init</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">(</span><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">Application</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"> </span><span class="gmail-pl-v" style="box-sizing:border-box;color:rgb(227,98,9);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">application</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">,</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"> </span><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">FHSyncConfig</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"> </span><span class="gmail-pl-v" style="box-sizing:border-box;color:rgb(227,98,9);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">config</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">, </span><span class="gmail-pl-smi" style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">String</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"> </span><span class="gmail-pl-v" style="box-sizing:border-box;color:rgb(227,98,9);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">cloudUrl</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">) method</span></div><div><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">in your Application object like this:</span></div><div><pre style="background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial"><span style="color:rgb(128,0,0);font-weight:bold">public</span><font color="#000000"> </font><span style="color:rgb(128,0,0);font-weight:bold">class</span><font color="#000000"> SyncApplication </font><span style="color:rgb(128,0,0);font-weight:bold">extends</span><font color="#000000"> Application </font><span style="color:rgb(128,0,128)">{</span><font color="#000000">

    </font><span style="color:rgb(128,128,48)">@</span><font color="#000000">Override
    </font><span style="color:rgb(128,0,0);font-weight:bold">public</span><font color="#000000"> </font><span style="color:rgb(187,121,119)">void</span><font color="#000000"> onCreate</font><span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><font color="#000000"> </font><span style="color:rgb(128,0,128)">{</span><font color="#000000">
        </font><span style="color:rgb(128,0,0);font-weight:bold">super</span><span style="color:rgb(128,128,48)">.</span><font color="#000000">onCreate</font><span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><span style="color:rgb(128,0,128)">;</span><font color="#000000">
        Sync</font><span style="color:rgb(128,128,48)">.</span><font color="#000000">init</font><span style="color:rgb(128,128,48)">(</span><font color="#000000">SyncApplication</font><span style="color:rgb(128,128,48)">.</span><span style="color:rgb(128,0,0);font-weight:bold">this</span><span style="color:rgb(128,128,48)">,</span><font color="#000000"> </font><span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,0,0);font-weight:bold">new</span><font color="#000000"> FHSyncConfig</font><span style="color:rgb(128,128,48)">.</span><font color="#000000">Builder</font><span style="color:rgb(128,128,48)">(</span><span style="color:rgb(128,128,48)">)</span><font color="#808030">)
</font><font color="#000000">.</font><span style="color:rgb(0,0,0);font-family:arial,sans-serif">useCustomSync</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">(</span><span style="color:rgb(128,0,0);font-family:arial,sans-serif;font-weight:bold">false</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">)</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">.</span><span style="color:rgb(0,0,0);font-family:arial,sans-serif">syncFrequencySeconds</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">(</span><span style="color:rgb(0,140,0);font-family:arial,sans-serif">10</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">)</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">.</span><span style="color:rgb(0,0,0);font-family:arial,sans-serif">notifyEnableAll</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">(</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">)</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">.</span><span style="color:rgb(0,0,0);font-family:arial,sans-serif">build</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">(</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">)</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">,</span><span style="color:rgb(0,0,0);font-family:arial,sans-serif"> </span><span style="color:rgb(0,0,230);font-family:arial,sans-serif">"<a href="http://192.168.13.14:3000/sync">http://192.168.13.14:3000/sync</a>"</span><span style="color:rgb(128,128,48);font-family:arial,sans-serif">)</span><span style="color:rgb(128,0,128);font-family:arial,sans-serif">;</span></pre><pre style="color:rgb(0,0,0);background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial">    <span style="color:rgb(128,0,128)">}</span>

<span style="color:rgb(128,0,128)">}</span></pre></div><div><div><br>When fh-android-sdk wrapper is written it should be still backwards compatibile with current old sync.<br><br><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><p style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:uppercase"><span>VOJTĚCH</span> <span>SÁZEL</span></p><p style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px 0px 4px;text-transform:uppercase"><span>SENIOR QUALITY ENGINEER, MOBILE QE</span></p><p style="font-family:overpass,sans-serif;margin:0px;font-size:10px;color:rgb(153,153,153)"><a href="https://www.redhat.com/" style="color:rgb(0,136,206);margin:0px" target="_blank">Red Hat <span><br><br></span></a></p><span style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"><p style="font-size:10px;margin:0px;color:rgb(153,153,153)">Remote Czech Republic</p></span><span style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"></span><p style="font-family:overpass,sans-serif;margin:0px 0px 6px;font-size:10px;color:rgb(153,153,153)"><span style="margin:0px;padding:0px"><a href="mailto:vsazel@redhat.com" style="color:rgb(0,136,206);margin:0px" target="_blank">vsazel@redhat.com</a>   </span> <span>IM: <span>vsazel</span></span></p><table border="0" style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"><tbody><tr><td width="100px"><a href="https://red.ht/sig" target="_blank"><img src="https://www.redhat.com/files/brand/email/sig-redhat.png" width="90" height="auto"></a></td></tr></tbody></table></div></div>
</div></div>