<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Android Archives - Tom Barbette</title>
	<atom:link href="https://perso.uclouvain.be/tom.barbette/category/passions/android/feed/" rel="self" type="application/rss+xml" />
	<link>https://perso.uclouvain.be/tom.barbette/category/passions/android/</link>
	<description></description>
	<lastBuildDate>Thu, 08 Oct 2015 12:51:49 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2022/04/cropped-logo-uclouvain-2021-barbette-32x32.png</url>
	<title>Android Archives - Tom Barbette</title>
	<link>https://perso.uclouvain.be/tom.barbette/category/passions/android/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Get a map (dictionnary) of arguments-&gt;value from an URI in Android with any API Level requirements</title>
		<link>https://perso.uclouvain.be/tom.barbette/get-a-map-dictionnary-of-arguments-value-from-an-uri-in-android-with-any-api-level-requirements/</link>
		
		<dc:creator><![CDATA[Tom Barbette]]></dc:creator>
		<pubDate>Fri, 20 Feb 2015 13:49:05 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[INFO-2051 Object-oriented programming on mobile devices]]></category>
		<guid isPermaLink="false">http://queen.run.montefiore.ulg.ac.be/~barbette/?p=415</guid>

					<description><![CDATA[<p>If someone wants to use the URI class to parse an URL in Android, and get the given parameters the normal way to do it is : String url = "http://www.example.com/?argument=value&#38;argument2=value2&#38;..."; Uri uri = Uri.parse(url); //To get the value of known parameters String argument = uri.getQueryParameter("argument"); String argument2 = uri.getQueryParameter("argument2"); ... //To look at all &#8230; </p>
<p class="link-more"><a href="https://perso.uclouvain.be/tom.barbette/get-a-map-dictionnary-of-arguments-value-from-an-uri-in-android-with-any-api-level-requirements/" class="more-link">Continue reading<span class="screen-reader-text"> "Get a map (dictionnary) of arguments->value from an URI in Android with any API Level requirements"</span></a></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/get-a-map-dictionnary-of-arguments-value-from-an-uri-in-android-with-any-api-level-requirements/">Get a map (dictionnary) of arguments-&gt;value from an URI in Android with any API Level requirements</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>If someone wants to use the URI class to parse an URL in Android, and get the given parameters the normal way to do it is :</p>
<pre>String url = "http://www.example.com/?argument=value&amp;argument2=value2&amp;...";
Uri uri = Uri.parse(url);

//To get the value of known parameters
String argument = uri.getQueryParameter("argument");
String argument2 = uri.getQueryParameter("argument2");
...

//To look at all parameters if you don't know what you're waiting for
for (String key : uri.getQueryParameterNames()) {
   String value = uri.getQueryParameter(key);
   //Do something with value  key, like using a switch/case
}</pre>
<p><code></code><br />
The problem with the first method is that :</p>
<ul>
<li>You need to know the arguments, and you cannot check if there is &#8220;unknow&#8221; arguments, like a malicious client trying to pass &#8220;include=X&#8221;</li>
<li>The query part of the URI is parsed each time you call setQueryParameter from the beginning !</li>
</ul>
<p>The problem with the second method  is that :</p>
<ul>
<li>When you call getQueryParameterNames() the whole query is parsed once</li>
<li>The query part of the URI is parsed each time you call setQueryParameter from the beginning !</li>
<li>getQueryParameterNames() is only available starting with Android 3.0 (API Level 11)</li>
</ul>
<p>So I wrote the code below, which gives you a map of argument-&gt;value in one reading. You can then call any map-related function like containsKey(key) to know if an argument is in the URL, entrySet() to iterate through all argument/value, keySet() to get all the arguments, and values() to get all values. This only parse the URL once and is much more convenient. This code is in distributed in any GPL variant, take the one you prefer.</p>
<pre>	/**
	 * Return a map of argument-&gt;value from a query in a URI
	 * @param uri The URI
	 */
	private Map&lt;String,String&gt; getQueryParameter(Uri uri) {
	    if (uri.isOpaque()) {
	    	return Collections.emptyMap();
	    }

	    String query = uri.getEncodedQuery();
	    if (query == null) {
	        return Collections.emptyMap();
	    }

	    Map&lt;String,String&gt; parameters = new LinkedHashMap&lt;String,String&gt;();
	    int start = 0;
	    do {
	        int next = query.indexOf('&amp;', start);
	        int end = (next == -1) ? query.length() : next;

	        int separator = query.indexOf('=', start);
	        if (separator &gt; end || separator == -1) {
	            separator = end;
	        }

	        String name = query.substring(start, separator);
	        String value;
	        if (separator &lt; end)
	        	value = query.substring(separator + 1, end);
	        else
	        	value = "";
	        
	        parameters.put(Uri.decode(name),Uri.decode(value));

	        // Move start to end of name.
	        start = end + 1;
	    } while (start &lt; query.length());

	    return Collections.unmodifiableMap(parameters);
	}
</pre>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/get-a-map-dictionnary-of-arguments-value-from-an-uri-in-android-with-any-api-level-requirements/">Get a map (dictionnary) of arguments-&gt;value from an URI in Android with any API Level requirements</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Huawei Honor 3 root + gapps + multilang</title>
		<link>https://perso.uclouvain.be/tom.barbette/huawei-honor-3-root-gapps-multilang/</link>
		
		<dc:creator><![CDATA[Tom Barbette]]></dc:creator>
		<pubDate>Wed, 12 Feb 2014 13:03:36 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[huawei]]></category>
		<category><![CDATA[rom]]></category>
		<category><![CDATA[root]]></category>
		<guid isPermaLink="false">http://queen.run.montefiore.ulg.ac.be/~barbette/?p=187</guid>

					<description><![CDATA[<p>From chinese to international version (with root, multilang and gapps) Just a little tuto about how I managed to re-flash the ROM of the Huawei Honor 3 bought in China with an international ROM from needrom.com. As you may know, all chinese smartphones may include an English version, but never the Google Play store, Gmail, &#8230; </p>
<p class="link-more"><a href="https://perso.uclouvain.be/tom.barbette/huawei-honor-3-root-gapps-multilang/" class="more-link">Continue reading<span class="screen-reader-text"> "Huawei Honor 3 root + gapps + multilang"</span></a></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/huawei-honor-3-root-gapps-multilang/">Huawei Honor 3 root + gapps + multilang</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>From chinese to international version (with root, multilang and gapps)</h3>
<p>Just a little tuto about how I managed to re-flash the ROM of the Huawei Honor 3 bought in China with an international ROM from needrom.com. As you may know, all chinese smartphones may include an English version, but never the Google Play store, Gmail, &#8230; And of course, are not rooted.</p>
<p>(On windows)</p>
<ol>
<li>Put your phone in USB debugging mode (see below if you don&#8217;t know how)</li>
<li>Go to http://www.needrom.com/mobile/huawei-honor-3/ (disable adblock if you have it)</li>
<li>Download the first file, not the updates. The others are original, un-rooter version without gapps and so on.</li>
<li>Run the .cmd file. (Without the chinese characters it&#8217;s called 3__HN3-U01_.cmd). It&#8217;s in chinese, but you just have to type &#8220;enter&#8221;.</li>
<li>After 2 or 3 minutes it will reboot in <strong>recovery mode</strong>.</li>
<li>Choose &#8220;Wipe data/factory reset&#8221;, and choose &#8220;yes &#8211; delete all data&#8221;. This step is very important. If you don&#8217;t do that, you&#8217;ll mix the two roms&#8230; Choose also &#8220;wipe cache&#8221;.</li>
<li>Choose &#8220;reboot now&#8221;.</li>
</ol>
<h4>Change language</h4>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Go in settings. It&#8217;s the icon on the main screen with a gear :</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155545.jpg"><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-232" alt="20140211_155545" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155545-e1392820759772-213x300.jpg" width="213" height="300" srcset="https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155545-e1392820759772-213x300.jpg 213w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155545-e1392820759772-729x1024.jpg 729w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155545-e1392820759772.jpg 1504w" sizes="(max-width: 213px) 100vw, 213px" /></a></p>
<p>Click on the language menu. It&#8217;s the one with an icon of letter&#8221;A&#8221; :</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155615.jpg"><img decoding="async" class="alignnone size-medium wp-image-233" alt="20140211_155615" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155615-e1392820973786-237x300.jpg" width="237" height="300" srcset="https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155615-e1392820973786-237x300.jpg 237w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155615-e1392820973786-811x1024.jpg 811w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155615-e1392820973786.jpg 1683w" sizes="(max-width: 237px) 100vw, 237px" /></a></p>
<p>Click on the first item and choose your preferred language :</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155648.jpg"><img decoding="async" class="alignnone size-medium wp-image-234" alt="20140211_155648" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155648-e1392820964802-223x300.jpg" width="223" height="300" srcset="https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155648-e1392820964802-223x300.jpg 223w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155648-e1392820964802-764x1024.jpg 764w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155648-e1392820964802.jpg 1452w" sizes="(max-width: 223px) 100vw, 223px" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h4>Enable USB debugging</h4>
<p>Like for the language, go in settings and choose &#8220;about phone&#8221; :</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155706.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-235" alt="20140211_155706" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155706-e1392820922432-225x300.jpg" width="225" height="300" /></a></p>
<p>&nbsp;</p>
<p>Type 7 times on the &#8220;build number menu&#8221;. I know it&#8217;s weard but it&#8217;s the way to do it !</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155718.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-236" alt="20140211_155718" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155718-e1392820877130-225x300.jpg" width="225" height="300" /></a></p>
<p>Now, click on the new menu that appeared &#8220;developer options&#8221;</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155732.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-237" alt="20140211_155732" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155732-e1392820851678-190x300.jpg" width="190" height="300" srcset="https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155732-e1392820851678-190x300.jpg 190w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155732-e1392820851678-650x1024.jpg 650w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155732-e1392820851678.jpg 1292w" sizes="auto, (max-width: 190px) 100vw, 190px" /></a></p>
<p>And finally, check usb debugging :</p>
<p><a href="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155745.jpg"><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-238" alt="20140211_155745" src="https://www.tombarbette.be/wp-content/uploads/2014/02/20140211_155745-e1392820810905-234x300.jpg" width="234" height="300" srcset="https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155745-e1392820810905-234x300.jpg 234w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155745-e1392820810905-800x1024.jpg 800w, https://perso.uclouvain.be/tom.barbette/wp-content/uploads/2014/02/20140211_155745-e1392820810905.jpg 1510w" sizes="auto, (max-width: 234px) 100vw, 234px" /></a></p>
<p>&nbsp;</p>
<p><span style="font-family: Bitter, Georgia, serif; font-size: 22px; line-height: 1.3;">Troubleshooting</span></p>
<ul>
<li><strong>Error at startup</strong> : your phone can tell you twice that a process has stop. It won&#8217;t come a third time, so just ignore that. You screen may be black a little too, just lock your phone, unlock in message modes and it won&#8217;t happen again.</li>
<li><strong>Get rid of the Huawei &#8220;home&#8221;</strong> : you cannot really remove it, but you can install &#8220;Apex launcher&#8221; or &#8220;Nova launcher&#8221; which arethe normal google home but slightly enhanced. After installing press the home button, choose the apex or nova launcher and type &#8220;always&#8221;. For them to work properly, you should install google search from the playstore too.</li>
<li><strong>If nothing happen after running the .cmd file</strong>, maybe you have a driver problem. Install the software of your phone (HiSuite for the Huawei Honor 3.</li>
<li>I woudn&#8217;t advise doing system <strong>updates</strong>. If it&#8217;s working, don&#8217;t try&#8230; If you want to try other roms like the ones of needrom.com, remember always to do a full wipe ! If the installer don&#8217;t reboot you in recovery, whhen the system has rebooted, go in the windows command line (type &#8220;cmd&#8221; in the windows search prompt), go to the folder where your rom installer is and type &#8220;adb reboot recovery&#8221; to reboot in recovery. I tried a lot of rom on this website and this was the best at time of writing&#8230; The only one removing the chinese apps and dooing everything I said is this one. And the changelog between the 113 and 119 version doesn&#8217;t seem that important&#8230;</li>
</ul>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/huawei-honor-3-root-gapps-multilang/">Huawei Honor 3 root + gapps + multilang</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Grignoux Cinema</title>
		<link>https://perso.uclouvain.be/tom.barbette/grignoux-cinema/</link>
		
		<dc:creator><![CDATA[Tom Barbette]]></dc:creator>
		<pubDate>Sun, 26 Jan 2014 21:33:27 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<guid isPermaLink="false">http://queen.run.montefiore.ulg.ac.be/~barbette/?p=141</guid>

					<description><![CDATA[<p>This post is in French as it concerns only people from my area Je suis l&#8217;auteur de l&#8217;application &#8220;Grignoux Cinéma&#8221; qui permet de voir les horaires des cinémas grignoux à Liège (Churchill, Parc et Sauvenière) sur les terminaux Android. J&#8217;ai déposé le code sur Github, et rend donc open source cette application (licence GPL). N&#8217;hésitez &#8230; </p>
<p class="link-more"><a href="https://perso.uclouvain.be/tom.barbette/grignoux-cinema/" class="more-link">Continue reading<span class="screen-reader-text"> "Grignoux Cinema"</span></a></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/grignoux-cinema/">Grignoux Cinema</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><em>This post is in French as it concerns only people from my area</em><br />
<br />
<center><img decoding="async" src="https://lh4.ggpht.com/jdACgxfmLO-Dlro-uMmLv_bhuwO9Ty1-NgikvSr-fAsI1UyugpvRdqqzfXQwegeP9_Z1=h900-rw" alt="Grignoux Cinema" width="200" /> <img decoding="async" src="https://lh5.ggpht.com/mqXgE6e3k1tO_T2OfdB_95p8LAjUl6fHTP7qposdUGAPCWQ6IxWB_2Vp6yNBnzRlcGg=h900-rw" alt="Grignoux Cinema" width="200" /></center><br />
<br />
Je suis l&#8217;auteur de l&#8217;application &#8220;Grignoux Cinéma&#8221; qui permet de voir les horaires des cinémas grignoux à Liège (Churchill, Parc et Sauvenière) sur les terminaux Android. J&#8217;ai déposé le code sur Github, et rend donc open source cette application (licence GPL). N&#8217;hésitez pas à contribuer, je manque un peu de temps&#8230; J&#8217;aimerais rajouter certains fonctions comme la recherche par cinéma, une légende, etc&#8230;<br />
<br />
<a href="https://github.com/tbarbette/grignouxcinema">Lien github</a></p>
<p><a href="https://play.google.com/store/apps/details?id=be.itstudents.tom.android.cinema">Lien Google Play Store</a><br /></p>
<p>The post <a href="https://perso.uclouvain.be/tom.barbette/grignoux-cinema/">Grignoux Cinema</a> appeared first on <a href="https://perso.uclouvain.be/tom.barbette">Tom Barbette</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
