<?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>Lorenz Blog</title>
	<atom:link href="http://www.londatiga.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.londatiga.net</link>
	<description>All About Web &#38; Mobile Application Development</description>
	<lastBuildDate>Thu, 21 Jan 2021 10:33:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.6.1</generator>
	<item>
		<title>How to Fix Blank Screen on WordPress Add/Edit Post Page</title>
		<link>http://www.londatiga.net/it/web/how-to-fix-blank-screen-on-wordpress-add-edit-post-page/</link>
					<comments>http://www.londatiga.net/it/web/how-to-fix-blank-screen-on-wordpress-add-edit-post-page/#respond</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Thu, 21 Jan 2021 10:26:47 +0000</pubDate>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[guttenberg]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1345</guid>

					<description><![CDATA[<p>I just updated my WordPress blog to version 5.6 and suddenly i got blank page while trying to add new post. I had no problem accessing another dashboard menus except the post page. So i tried googling it and found some suggestions like disabling all plugins and tried to downgrade the wordpress version. I tried [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/web/how-to-fix-blank-screen-on-wordpress-add-edit-post-page/">How to Fix Blank Screen on WordPress Add/Edit Post Page</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I just updated my <a href="https://wordpress.org/">WordPress</a> blog to version 5.6 and suddenly i got blank page while trying to add new post. I had no problem accessing another dashboard menus except the post page.</p>
<p>So i tried googling it and found some suggestions like disabling all plugins and tried to downgrade the wordpress version. I tried those suggestions but nothing worked.</p>
<p>There was a suggestion to <strong>disable</strong> the <strong>Guttenberg</strong> editor by installing <a href="https://wordpress.org/plugins/disable-gutenberg/">Disable Guttenberg</a> plugin. I tried it and it worked like a charm.  The conflict was caused by WordPress 5.6 updated Gutenberg editor with our theme’s visual editor.</p>
<p>So here the step steps:</p>
<ul>
<li>Go to Plugin page and search for Disable Guttenberg plugin</li>
<li>Install and activate the plugin</li>
<li>The blank screen issue will disapear.</li>
</ul>
<p>Hope it helps.</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/web/how-to-fix-blank-screen-on-wordpress-add-edit-post-page/">How to Fix Blank Screen on WordPress Add/Edit Post Page</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/web/how-to-fix-blank-screen-on-wordpress-add-edit-post-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Programmatically Restart the ESP32 Board</title>
		<link>http://www.londatiga.net/it/iot/how-to-programmatically-restart-the-esp32-board/</link>
					<comments>http://www.londatiga.net/it/iot/how-to-programmatically-restart-the-esp32-board/#respond</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Thu, 06 Jun 2019 02:38:09 +0000</pubDate>
				<category><![CDATA[IOT]]></category>
		<category><![CDATA[Micro Controller]]></category>
		<category><![CDATA[board]]></category>
		<category><![CDATA[esp32]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[restart]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1333</guid>

					<description><![CDATA[<p>ESP32 development board is one of the popular board across the  IOT developer community. It is because the board itself packed with two built-in communication features, Wifi and Bluetooth (BLE). When programming a controller, sometimes we need to add the restart feature that let the user manually restart or reset the board. Below is the code [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/iot/how-to-programmatically-restart-the-esp32-board/">How to Programmatically Restart the ESP32 Board</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://www.espressif.com/en/products/hardware/esp32/overview">ESP32</a> development board is one of the popular board across the  <strong>IOT</strong> developer community. It is because the board itself packed with two built-in communication features, Wifi and Bluetooth (BLE). When programming a controller, sometimes we need to add the <strong>restart </strong>feature that let the user manually restart or reset the board.</p>
<p>Below is the code to restart the board:</p>
<pre class="brush: cpp; title: ; notranslate">
esp_task_wdt_init(1,true);
esp_task_wdt_add(NULL);

while(true);
</pre>
<p>Also include these two header files:</p>
<pre class="brush: cpp; title: ; notranslate">
#include &lt;esp_int_wdt.h&gt;
#include &lt;esp_task_wdt.h&gt;
</pre>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/iot/how-to-programmatically-restart-the-esp32-board/">How to Programmatically Restart the ESP32 Board</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/iot/how-to-programmatically-restart-the-esp32-board/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Get Hardware Info of ESP32</title>
		<link>http://www.londatiga.net/it/iot/how-to-get-hardware-info-of-esp32/</link>
					<comments>http://www.londatiga.net/it/iot/how-to-get-hardware-info-of-esp32/#respond</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Thu, 06 Jun 2019 02:18:57 +0000</pubDate>
				<category><![CDATA[IOT]]></category>
		<category><![CDATA[Micro Controller]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[esp32]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[iot]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1328</guid>

					<description><![CDATA[<p>With the increasing popular of IOT technologies, there are also available development boards from many manufacturers. One of popular board is ESP32 which comes with integrated wifi and bluetooth (BLE) capability. We can use Arduino framework to program the board either using Arduino IDE or other IDE like Atom Platformio. Sometimes we need to get hardware [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/iot/how-to-get-hardware-info-of-esp32/">How to Get Hardware Info of ESP32</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>With the increasing popular of <a href="http://www.londatiga.net/category/it/iot/">IOT</a> technologies, there are also available development boards from many manufacturers. One of popular board is <strong>ESP32</strong> which comes with integrated wifi and bluetooth (BLE) capability. We can use Arduino framework to program the board either using Arduino IDE or other IDE like <a href="https://platformio.org/install/ide?install=atom">Atom Platformio</a>.</p>
<p>Sometimes we need to get hardware info from each board we develop, either to show it to user or just show them on log messages. On <a href="https://www.espressif.com/en/products/hardware/development-boards">Esp32</a>, to get the hardware info, use the following code:</p>
<pre class="brush: cpp; title: ; notranslate">
    esp_chip_info_t chip_info;
    esp_chip_info(&amp;chip_info);

    Serial.println(&quot;Hardware info&quot;);
    Serial.printf(&quot;%d cores Wifi %s%s\n&quot;, chip_info.cores, (chip_info.features &amp; CHIP_FEATURE_BT) ? &quot;/BT&quot; : &quot;&quot;,
     (chip_info.features &amp; CHIP_FEATURE_BLE) ? &quot;/BLE&quot; : &quot;&quot;);
    Serial.printf(&quot;Silicon revision: %d\n&quot;, chip_info.revision);
    Serial.printf(&quot;%dMB %s flash\n&quot;, spi_flash_get_chip_size()/(1024*1024),
    (chip_info.features &amp; CHIP_FEATURE_EMB_FLASH) ? &quot;embeded&quot; : &quot;external&quot;);

    //get chip id
    chipId = String((uint32_t)ESP.getEfuseMac(), HEX);
    chipId.toUpperCase();

    Serial.printf(&quot;Chip id: %s\n&quot;, chipId.c_str());
</pre>
<p>Don&#8217;t forget to include the ESP.h header file. Happy coding!</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/iot/how-to-get-hardware-info-of-esp32/">How to Get Hardware Info of ESP32</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/iot/how-to-get-hardware-info-of-esp32/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Setup MQTT Server Using Mosquitto and Libwebsocket on Freebsd</title>
		<link>http://www.londatiga.net/featured-articles/how-to-setup-mqtt-server-using-mosquitto-and-libwebsocket-on-freebsd/</link>
					<comments>http://www.londatiga.net/featured-articles/how-to-setup-mqtt-server-using-mosquitto-and-libwebsocket-on-freebsd/#respond</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Thu, 30 May 2019 10:09:33 +0000</pubDate>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[IOT]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[iot]]></category>
		<category><![CDATA[mosquitto]]></category>
		<category><![CDATA[mqtt]]></category>
		<category><![CDATA[websocket]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1317</guid>

					<description><![CDATA[<p>Recently i&#8217;m working on IOT project that needs to send data from ESP32 development board to web browser and mobile devices using MQTT protocol. The MQTT connection between the board and other clients didn&#8217;t have problems using standard/native MQTT protocol, but it came into problem when the client was a web browser. The standard MQTT [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/featured-articles/how-to-setup-mqtt-server-using-mosquitto-and-libwebsocket-on-freebsd/">How to Setup MQTT Server Using Mosquitto and Libwebsocket on Freebsd</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently i&#8217;m working on <strong>IOT</strong> project that needs to send data from <strong>ESP32</strong> development board to web browser and mobile devices using <strong>MQTT</strong> protocol. The MQTT connection between the board and other clients didn&#8217;t have problems using standard/native MQTT protocol, but it came into problem when the client was a web browser. The standard MQTT protocol doesn&#8217;t work with <a href="https://www.eclipse.org/paho/clients/js/">Eclipse Paho Javascript library</a> which works on top of <strong>websocket</strong> protocol.</p>
<p style="padding: 2px 6px 4px 6px; color: #ffffff; background-color: #ff0202; border: #e00404 2px solid;"><em>WebSocket connection to &#8216;ws://123.11.11.11:8883/mqtt&#8217; failed: Connection closed before receiving a handshake response</em></p>
<p>The above error message was from javascript library when i tried to connect MQTT server that didn&#8217;t support websocket. My previous MQTT server was installed with <a href="https://mosquitto.org/">Mosquitto</a> running on <strong>Freebsd</strong> and it worked well with standard MQTT connection. The standard installation of Mosquitto didn&#8217;t support websocket so i had to install additional <strong>libwebsocket</strong> library and recompiled the Mosquitto.</p>
<p>So here are the requirements and steps to upgrade or setup MQTT server with websocket support using Mosquitto on a FreeBSD server:</p>
<p>Requirements:</p>
<ul>
<li><a href="https://mosquitto.org/files/source/mosquitto-1.6.2.tar.gz">Mosquitto 1.6.2</a>,   (<a href="https://mosquitto.org/download/">latest stable version</a> )</li>
<li><a href="https://github.com/iblis17/ports/tree/master/net/libwebsockets">Libwebsocket-2.4.2</a>, (latest stable version)</li>
</ul>
<p><strong>Installation:</strong></p>
<p><strong><em>Libwebsocket</em></strong></p>
<p>Install libwebsocket from Freebsd ports</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#cd /usr/ports/net/libwebsockets</p>
<p>Check the version (2.4.2) (view the <em>distinfo</em> file), if you have old version then backup the libwebsockets port directory</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#mv libwebsockets libwebsockets.old</p>
<p>Download and extract the libwebsocket port file</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#wget http://www.londatiga.net/downloads/iot/libwebsockets-ports-2.4.2.tar.gz<br />
#tar -xzvf libwebsockets-ports-2.4.2.tar.gz<br />
#cd libwebsockets</p>
<p>Compile and install</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#make<br />
#make install</p>
<p>If installation succes, make sure these files exist:</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">/usr/local/lib/libwebsockets.so<br />
/usr/local/lib/libwebsockets.so.12<br />
/usr/local/include/libwebsockets.h</p>
<p><em><strong>Mosquitto</strong></em></p>
<p>Download and extract the source file</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#wget https://mosquitto.org/files/source/mosquitto-1.6.2.tar.gz<br />
#tar -xzvf mosquitto-1.6.2.tar.gz<br />
#cd mosquitto-1.6.2</p>
<p>Edit <em>config.mk</em> file to enable websocket. Replace the line <em>WITH_WEBSOCKETS:=no</em> with <strong><em>WITH_WEBSOCKETS:=yes</em></strong></p>
<p>Copy libwebsocket header files into <em>src</em> directory</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#cp /usr/local/include/libwebsockets.h src<br />
#cp /usr/local/include/lws_config.h src<br />
#cp /usr/local/include/uv* src<br />
#cp /usr/local/include/ev.h src</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#gmake<br />
#gmake install</p>
<p><strong>Troubleshouting:</strong></p>
<p>You may find some errors while compiling and installing mosquitto, here are some issues:</p>
<p><strong><em>Issues with openssl</em>:</strong></p>
<p>This issue due to incompatible <strong>openssl</strong> version, mosquitto 1.6.2 requires openssl &gt;= 1.0.2, so you may get this error messages while compiling:</p>
<p style="padding: 2px 6px 4px 6px; color: #ffffff; background-color: #ff0202; border: #e00404 2px solid;"><em>../lib/libmosquitto.so.1: undefined reference to `SSL_CTX_set_alpn_protos</em></p>
<p>The solution is to lower the version of mosquitto, you can use version <a href="https://mosquitto.org/files/source/mosquitto-1.5.8.tar.gz">1.5.8</a>.</p>
<p><em><strong>Issues with linking dynamic library lwebsockets</strong></em></p>
<p style="padding: 2px 6px 4px 6px; color: #ffffff; background-color: #ff0202; border: #e00404 2px solid;"><em>/usr/bin/ld: cannot find -lwebsockets</em></p>
<p>This issue due to the compiler doesn&#8217;t find the <strong>libwebsockets.so</strong> shared library, the solution is to create symbolic link from <em>/usr/local/lib/libwebsockets.so</em> to <em>/lib/libwebsockets.so</em></p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#ln -s /usr/local/lib/libwebsockets.so /lib/libwebsockets.so</p>
<p><strong>Issues while installing (gmake install)</strong></p>
<p style="padding: 2px 6px 4px 6px; color: #ffffff; background-color: #ff0202; border: #e00404 2px solid;"><em>install -m644 ../libmosquitto.pc.in &#8220;/usr/local/lib/pkgconfig/libmosquitto.pc&#8221;<br />
sed -i -e &#8220;s#@CMAKE_INSTALL_PREFIX@#/usr/local#&#8221; -e &#8220;s#@VERSION@#1.5.8#&#8221; &#8220;/usr/local/lib/pkgconfig/libmosquitto.pc&#8221;<br />
sed: -e: No such file or directory</em></p>
<p>This issue due to invalid <em>sed -e</em> command while trying to replace the CMAKE_INSTALL_PREFIX and VERSION on <em>/usr/local/lib/pkgconfig/libmosquitto.pc</em> file. I&#8217;m not expert on <em>sed </em>command, so my solution is to edit this two files two <em>Makefiles</em>:</p>
<ul>
<li>lib/Makefile</li>
<li>lib/cpp/Makefile</li>
</ul>
<p>find this line:</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">sed -i -e &#8220;s#@CMAKE_INSTALL_PREFIX@#${prefix}#&#8221; -e &#8220;s#@VERSION@#${VERSION}#&#8221; &#8220;${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc&#8221;</p>
<p>Remove the <strong>-e &#8220;s#@CMAKE_INSTALL_PREFIX@#${prefix}#</strong>&#8221;  section so the result would be:</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">sed -i -e &#8220;s#@VERSION@#${VERSION}#&#8221; &#8220;${DESTDIR}${libdir}/pkgconfig/libmosquitto.pc&#8221;</p>
<p>Then run <em>#gmake install</em> again and after successfully installing, don&#8217;t forget to update the <strong><em>/usr/local/lib/pkgconfig/libmosquitto.pc file</em></strong>, replace the <strong><em>@CMAKE_INSTALL_PREFIX@</em></strong> with <strong><em>/usr/local.</em></strong></p>
<p><strong>Setting up Mosquitto</strong></p>
<p>Create a user to run mosquitto, we use <em>mosquitto</em> as the username with <em>nologin</em> and <em>nonexistent</em> options.</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#adduser<br />
Username: mosquitto<br />
Full name: Mosquitto MQTT Broker<br />
&#8230;..<br />
Shell (sh csh tcsh git-shell nologin) [sh]: nologin<br />
Home directory [/home/mosquitto]: /nonexistent</p>
<p>Change ownership of the directory <em>/var/lib/mosquitto/mosquitto.db</em> to <em>mosquitto </em>(if not exist, create new one)</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#chown mosquitto /var/lib/mosquitto/mosquitto.db</p>
<p>Create a file log /var/log/mosquitto.log</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#touch /var/log/mosquitto.log<br />
#chown mosquitto /var/log/mosquitto.log</p>
<p>Create http dir for websocket</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#mkdir /var/lib/mosquitto/http_dir<br />
#chown mosquitto /var/lib/mosquitto/http_dir</p>
<p>Create username and password for MQTT authentication</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#mosquitto_passwd -c /etc/mosquitto/pwfile lorenz<br />
Password:<br />
Reenter password:</p>
<p>Replace the &#8216;<em>lorenz</em>&#8216; with your username.</p>
<p>Create the configuration file /etc/mosquitto/mosquitto.conf and use the following configuration</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">listener 9001 xx.xx.xx.xx<br />
protocol websockets<br />
socket_domain ipv4<br />
http_dir /var/lib/mosquitto/http_dir<br />
listener 8883 xx.xx.xx.xx<br />
protocol mqtt<br />
persistence_location /var/lib/mosquitto/<br />
persistence_file mosquitto.db<br />
log_dest syslog<br />
log_dest stdout<br />
log_dest topic<br />
log_dest file /var/log/mosquitto.log<br />
log_type error<br />
log_type warning<br />
log_type notice<br />
log_type information<br />
connection_messages true<br />
log_timestamp true<br />
allow_anonymous false<br />
password_file /etc/mosquitto/pwfile<br />
user mosquitto</p>
<p>Here, we use port 9001 for MQTT over websockets and 8883 for standard/native MQTT. Replace the xx.xx.xx.xx with your hostname or ip address. You can use whatever port number as you like as long as the number isn&#8217;t being used by other service or application.</p>
<p>Run the mosquitto service</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">#mosquitto -c /etc/mosquitto/mosquitto.conf</p>
<p>You should see these messages on starting up:</p>
<p style="padding: 2px 6px 4px 6px; color: #555555; background-color: #eeeeee; border: #dddddd 2px solid;">1559210145: mosquitto version 1.5.8 starting<br />
1559210145: Config loaded from /etc/mosquitto/mosquitto.conf.<br />
1559210145: Opening <strong>websockets</strong> listen socket on port <strong>9001</strong>.<br />
1559210145: Opening ipv4 listen socket on port <strong>8883</strong>.</p>
<p>Based on the above configuration, you should use port 9001 for connection with javascript library on web browser and 8883 on other devices. The message will be automatically forwarded between those ports. So the message that you send on 8883 will also be received on javascript client on port 9001.</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/featured-articles/how-to-setup-mqtt-server-using-mosquitto-and-libwebsocket-on-freebsd/">How to Setup MQTT Server Using Mosquitto and Libwebsocket on Freebsd</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/featured-articles/how-to-setup-mqtt-server-using-mosquitto-and-libwebsocket-on-freebsd/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Eclipse Issue on Os X Yosemite &#8211; To open “Eclipse” you need to install the legacy Java SE 6 runtime</title>
		<link>http://www.londatiga.net/it/programming/eclipse-issue-os-x-yosemite-to-open-eclipse-you-need-to-install-the-legacy-java-se-6-runtime/</link>
					<comments>http://www.londatiga.net/it/programming/eclipse-issue-os-x-yosemite-to-open-eclipse-you-need-to-install-the-legacy-java-se-6-runtime/#respond</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Fri, 24 Apr 2015 00:38:21 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java runtime]]></category>
		<category><![CDATA[mac os]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[yosemite]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1286</guid>

					<description><![CDATA[<p>Recently i just upgraded my Macbook Pro to the new Macbook Retina Display (mid 2014) that comes default with OS X Yosemite 10.10.1. After installing Java JDK 1.8, all my Android IDE (Eclipse and Android Studio) work well so i can continue my development as usual. The problem comes when i update the OS X [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/eclipse-issue-os-x-yosemite-to-open-eclipse-you-need-to-install-the-legacy-java-se-6-runtime/">Eclipse Issue on Os X Yosemite &#8211; To open “Eclipse” you need to install the legacy Java SE 6 runtime</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently i just upgraded my Macbook Pro to the new Macbook Retina Display (mid 2014) that comes default with <a title="Mac OS X" href="http://www.londatiga.net/category/it/software/mac-os/" target="_blank">OS X</a> Yosemite 10.10.1. After installing Java JDK 1.8, all my <strong>Android</strong> IDE (<strong>Eclipse</strong> and Android Studio) work well so i can continue my development as usual. The problem comes when i update the OS X to Yosemite 10.10.3, my Eclipse won&#8217;t open anymore. When i start Eclipse by clicking on its icon, the warning dialog appears saying<em> &#8216;To open “Eclipse” you need to install the legacy Java SE 6 runtime&#8217;</em>.</p>
<figure id="attachment_1289" aria-describedby="caption-attachment-1289" style="width: 300px" class="wp-caption alignnone"><a href="http://www.londatiga.net/wp-content/uploads/2015/04/eclipse-os-x-yosemite-problem.png"><img loading="lazy" class="size-medium wp-image-1289" alt="eclipse problem on os x yosemite" src="http://www.londatiga.net/wp-content/uploads/2015/04/eclipse-os-x-yosemite-problem-300x119.png" width="300" height="119" srcset="http://www.londatiga.net/wp-content/uploads/2015/04/eclipse-os-x-yosemite-problem-300x119.png 300w, http://www.londatiga.net/wp-content/uploads/2015/04/eclipse-os-x-yosemite-problem.png 868w" sizes="(max-width: 300px) 100vw, 300px" /></a><figcaption id="caption-attachment-1289" class="wp-caption-text">eclipse problem on os x yosemite</figcaption></figure>
<p>The suggested solution is to install Java SE 6 runtime from <a href="https://support.apple.com/kb/DL1572?locale=en_US">Apple website </a> by clicking the <em>More Info</em> button. But because the internet service is expensive here and i don&#8217;t want to spend extra internet quota to download the java update,i do some googlings and found an alternative solution.</p>
<p>The solution is simple, just to make some changes the Info.plist file in Java library folder:</p>
<ul>
<li>Locate the Info.plist in your JDK folder, mine is under
<pre class="brush: java; title: ; notranslate">
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/
</pre>
</li>
<li>Edit the Info.plist file using your favorite editor
<pre class="brush: java; title: ; notranslate">
$vim /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Info.plist
</pre>
</li>
<li>Find the following lines
<pre class="brush: java; title: ; notranslate">
&lt;key&gt;JVMCapabilities&lt;/key&gt;
&lt;array&gt;
  &lt;string&gt;CommandLine&lt;/string&gt;
&lt;/array&gt;
</pre>
</li>
<li>Replace those lines with
<pre class="brush: java; title: ; notranslate">
&lt;key&gt;JVMCapabilities&lt;/key&gt;
&lt;array&gt;
  &lt;string&gt;JNI&lt;/string&gt;
  &lt;string&gt;BundledApp&lt;/string&gt;
  &lt;string&gt;WebStart&lt;/string&gt;
  &lt;string&gt;Applets&lt;/string&gt;
  &lt;string&gt;CommandLine&lt;/string&gt;
&lt;/array&gt;
</pre>
</li>
<li>Restart the OS X so the changes will take effect</li>
</ul>
<p>Hope it helps.</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/eclipse-issue-os-x-yosemite-to-open-eclipse-you-need-to-install-the-legacy-java-se-6-runtime/">Eclipse Issue on Os X Yosemite &#8211; To open “Eclipse” you need to install the legacy Java SE 6 runtime</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/programming/eclipse-issue-os-x-yosemite-to-open-eclipse-you-need-to-install-the-legacy-java-se-6-runtime/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Blue Bamboo P25 Printer Android Demo Application With Source Code</title>
		<link>http://www.londatiga.net/featured-articles/blue-bamboo-p25-printer-android-demo-application-with-source-code/</link>
					<comments>http://www.londatiga.net/featured-articles/blue-bamboo-p25-printer-android-demo-application-with-source-code/#comments</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Fri, 28 Feb 2014 06:15:26 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[blue bambbo]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[demo application]]></category>
		<category><![CDATA[p25]]></category>
		<category><![CDATA[printer]]></category>
		<category><![CDATA[source code]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1275</guid>

					<description><![CDATA[<p>Blue Bamboo P25 printer is a lightweight and portable thermal printer that provides low cost printing in mobile and wireless environments. It supports mobile application printing over Bluetooth, USB or Serial port (RS-232). It also has a good connectivity with Android device, makes printing from Android becomes very easy and fast. Blue Bamboo also provides [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/featured-articles/blue-bamboo-p25-printer-android-demo-application-with-source-code/">Blue Bamboo P25 Printer Android Demo Application With Source Code</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><a href="https://bluebamboo.com/products/show.asp?id=16" target="_blank">Blue Bamboo P25</a> printer is a lightweight and portable thermal printer that provides low cost printing in mobile and wireless environments. It supports mobile application printing over <a href="http://www.londatiga.net/tag/bluetooth" target="_blank">Bluetooth</a>, USB or Serial port (RS-232). It also has a good connectivity with Android device, makes printing from <a href="http://www.londatiga.net/category/it/programming/android/" target="_blank">Android</a> becomes very easy and fast.</p>
<p style="text-align: center;"><img loading="lazy" class="aligncenter" alt="P25 Printer Android" src="http://londatiga.net/images/printer_bluebamboo_p25.png" width="240" height="320" /></p>
<p>Blue Bamboo also provides a sample Android project to show how to build an application that supports printing using P25 printer over Bluetooth. The source code itself is quite old so i made a slight modification with fresh UI and easy to read source code so developers can easily implement the codes into their projects.</p>
<p style="text-align: center;"><img loading="lazy" class="aligncenter" alt="P25 Android Application Demo" src="http://londatiga.net/images/android_bluebamboo_p25_demo.png" width="180" height="320" /></p>
<p>This sample code shows how to print text, image, barcode and receipt into P25 printer using Bluetooth connectivity. The source code is available on Github repo, you can find it at the bottom of this post.</p>
<p><strong>Print Text</strong></p>
<pre class="brush: java; title: ; notranslate">
private void printText(String text) {
	byte[] line 	= Printer.printfont(text + &quot;\n\n&quot;, FontDefine.FONT_32PX, FontDefine.Align_CENTER, (byte) 0x1A, PocketPos.LANGUAGE_ENGLISH);
	byte[] senddata = PocketPos.FramePack(PocketPos.FRAME_TOF_PRINT, line, 0, line.length);

	sendData(senddata);
}
</pre>
<p>Use <span style="color: #008000;"><em>Printer.printFont(String content, byte fonttype, byte fontalign,byte linespace, byte language)</em> </span>method to format and position the text. For font types and text alignment, see <span style="color: #008000;">FontDefine.java</span> and for language definition, see <span style="color: #008000;">PocketPos.java</span>. Also call the <em><span style="color: #008000;">PocketPos.FramePack(byte typeFrame, byte[] srcBuff, int srcOffset, int srcLen)</span> </em>to create frame data before sending to printer.</p>
<p>See <a href="http://www.londatiga.net/downloads/P25_Development_Guide_V3.9(2012-12-31).pdf" target="_blank">P25 development guide</a> page 60-63 for more information.</p>
<p><strong>Print 1D Barcode</strong></p>
<pre class="brush: java; title: ; notranslate">
private void print1DBarcode() {
	String content	= &quot;6901234567892&quot;;

	byte[] formats	= {(byte) 0x1d, (byte) 0x6b, (byte) 0x02, (byte) 0x0d};
	byte[] contents	= content.getBytes();

	byte[] bytes	= new byte[formats.length + contents.length];

	System.arraycopy(formats, 0, bytes, 0, formats.length);
	System.arraycopy(contents, 0, bytes, formats.length, contents.length);

	sendData(bytes);

	byte[] newline 	= Printer.printfont(&quot;\n\n&quot;,FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);

	sendData(newline);
}
</pre>
<p>1D barcode printing format is: <span style="color: #008000;">1d 6b 02 0d [barcode data]</span>. So to print &#8220;6901234567892&#8221; barcode data, the bytes would be:</p>
<p><span style="color: #008000;">{(byte) 0x1d, (byte) 0x6b, (byte) 0x02, (byte) 0x0d}</span><br />
<span style="color: #008000;"> +</span><br />
<span style="color: #008000;"> &#8220;6901234567892&#8221;.getBytes()</span></p>
<p>See <a href="http://www.londatiga.net/downloads/P25_Development_Guide_V3.9(2012-12-31).pdf" target="_blank">P25 development guide</a> page 59-60 for more information.</p>
<p><strong>Print 2D Barcode</strong></p>
<pre class="brush: java; title: ; notranslate">
private void print2DBarcode() {
	String content 	= &quot;Lorenz Blog - www.londatiga.net&quot;;

	byte[] formats	= {(byte) 0x1d, (byte) 0x6b, (byte) 0x10, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
						  (byte) 0x00, (byte) 0x1f};
	byte[] contents	= content.getBytes();
	byte[] bytes	= new byte[formats.length + contents.length];

	System.arraycopy(formats, 0, bytes, 0, formats.length);
	System.arraycopy(contents, 0, bytes, formats.length, contents.length);

	sendData(bytes);

	byte[] newline 	= Printer.printfont(&quot;\n\n&quot;,FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);

	sendData(newline);
}
</pre>
<p>2D barcode printing format is:<span style="color: #008000;"> 1d 6b 10 00 00 00 00 00 1f + barcode data</span>. So to print &#8220;Lorenz Blog &#8211; www.londatiga.net&#8221; text, the bytes would be:</p>
<p><span style="color: #008000;">{(byte) 0x1d, (byte) 0x6b, (byte) 0x10, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x1f}</span><br />
<span style="color: #008000;"> +</span><br />
<span style="color: #008000;"> &#8220;Lorenz Blog &#8211; www.londatiga.net&#8221;.getBytes()</span></p>
<p>See <a href="http://www.londatiga.net/downloads/P25_Development_Guide_V3.9(2012-12-31).pdf" target="_blank">P25 development guide</a> page 60 for more information</p>
<p><strong>Print Image</strong></p>
<pre class="brush: java; title: ; notranslate">
private void printImage() {
	try {
		byte[] formats	= { (byte)0x1B, (byte)0x58, (byte)0x31, (byte)0x24, (byte)0x2D };

		//bluebamboo logo
		byte[] image = {(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00,(byte)0x00, ....... (byte)0x00};

		sendData(bytes);

		byte[] newline 	= Printer.printfont(&quot;\n\n&quot;,FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);

		sendData(newline);
	} catch (Exception e) {
		e.printStackTrace();
	}
}
</pre>
<p>Image printing format is: <span style="color: #008000;">1B 58 31 xx yy + {image data in bitmap monochrome format}</span> where xx is width in pixels/8 and yy is height of image in pixels.</p>
<p>So to print 200&#215;45 pixels of image, the format would be :</p>
<p><span style="color: #008000;">{ (byte)0x1B, (byte)0x58, (byte)0x31, (byte)0x24, (byte)0x2D } + { bytes of bitmap monochrome image}</span></p>
<p>Width = 200pixels/8bit = 25 in decimals = 0x24 in hexa<br />
Height= 45 pixels in decimal = 0x2D in hexa</p>
<p>See http://bluebamboo.helpserve.com/index.php?/Knowledgebase/Article/View/48 for more information on how to print image and <a href="http://www.londatiga.net/downloads/P25_Development_Guide_V3.9(2012-12-31).pdf" target="_blank">P25 development guide</a> page 18-13 and 63.</p>
<p><strong>Print Sample Receipt</strong></p>
<pre class="brush: java; title: ; notranslate">
private void printStruk() {
		String titleStr	= &quot;STRUK PEMBAYARAN TAGIHAN LISTRIK&quot; + &quot;\n\n&quot;;

		StringBuilder contentSb	= new StringBuilder();

		contentSb.append(&quot;IDPEL     : 435353535435353&quot; + &quot;\n&quot;);
		contentSb.append(&quot;NAMA      : LORENSIUS WLT&quot; + &quot;\n&quot;);
		contentSb.append(&quot;TRF/DAYA  : 50/12244 VA&quot; + &quot;\n&quot;);
		contentSb.append(&quot;BL/TH     : 02/14&quot; + &quot;\n&quot;);
		contentSb.append(&quot;ST/MTR    : 0293232&quot; + &quot;\n&quot;);
		contentSb.append(&quot;RP TAG    : Rp. 100.000&quot; + &quot;\n&quot;);
		contentSb.append(&quot;JPA REF   :&quot; + &quot;\n&quot;);

		StringBuilder content2Sb = new StringBuilder();

		content2Sb.append(&quot;ADM BANK  : Rp. 1.600&quot; + &quot;\n&quot;);
		content2Sb.append(&quot;RP BAYAR  : Rp. 101.600,00&quot; + &quot;\n&quot;);

		String jpaRef	= &quot;XXXX-XXXX-XXXX-XXXX&quot; + &quot;\n&quot;;
		String message	= &quot;PLN menyatakan struk ini sebagai bukti pembayaran yang sah.&quot; + &quot;\n&quot;;
		String message2	= &quot;Rincian tagihan dapat diakses di www.pln.co.id Informasi Hubungi Call Center: &quot;
						+ &quot;123 Atau Hub PLN Terdekat: 444&quot; + &quot;\n&quot;;

		long milis		= System.currentTimeMillis();
		String date		= DateUtil.timeMilisToString(milis, &quot;dd-MM-yy / HH:mm&quot;)  + &quot;\n\n&quot;;

		byte[] titleByte	= Printer.printfont(titleStr, FontDefine.FONT_24PX,FontDefine.Align_CENTER,
								(byte)0x1A, PocketPos.LANGUAGE_ENGLISH);

		byte[] content1Byte	= Printer.printfont(contentSb.toString(), FontDefine.FONT_24PX,FontDefine.Align_LEFT,
								(byte)0x1A, PocketPos.LANGUAGE_ENGLISH);

		byte[] refByte		= Printer.printfont(jpaRef, FontDefine.FONT_24PX,FontDefine.Align_CENTER,  (byte)0x1A,
								PocketPos.LANGUAGE_ENGLISH);

		byte[] messageByte	= Printer.printfont(message, FontDefine.FONT_24PX,FontDefine.Align_CENTER,  (byte)0x1A,
								PocketPos.LANGUAGE_ENGLISH);

		byte[] content2Byte	= Printer.printfont(content2Sb.toString(), FontDefine.FONT_24PX,FontDefine.Align_LEFT,
								(byte)0x1A, PocketPos.LANGUAGE_ENGLISH);

		byte[] message2Byte	= Printer.printfont(message2, FontDefine.FONT_24PX,FontDefine.Align_CENTER,  (byte)0x1A,
								PocketPos.LANGUAGE_ENGLISH);

		byte[] dateByte		= Printer.printfont(date, FontDefine.FONT_24PX,FontDefine.Align_LEFT, (byte)0x1A,
								PocketPos.LANGUAGE_ENGLISH);

		byte[] totalByte	= new byte[titleByte.length + content1Byte.length + refByte.length + messageByte.length +
		                	           content2Byte.length + message2Byte.length + dateByte.length];

		int offset = 0;
		System.arraycopy(titleByte, 0, totalByte, offset, titleByte.length);
		offset += titleByte.length;

		System.arraycopy(content1Byte, 0, totalByte, offset, content1Byte.length);
		offset += content1Byte.length;

		System.arraycopy(refByte, 0, totalByte, offset, refByte.length);
		offset += refByte.length;

		System.arraycopy(messageByte, 0, totalByte, offset, messageByte.length);
		offset += messageByte.length;

		System.arraycopy(content2Byte, 0, totalByte, offset, content2Byte.length);
		offset += content2Byte.length;

		System.arraycopy(message2Byte, 0, totalByte, offset, message2Byte.length);
		offset += message2Byte.length;

		System.arraycopy(dateByte, 0, totalByte, offset, dateByte.length);

		byte[] senddata = PocketPos.FramePack(PocketPos.FRAME_TOF_PRINT, totalByte, 0, totalByte.length);

		sendData(senddata);
}
</pre>
<p><strong>Print Demo Page</strong></p>
<pre class="brush: java; title: ; notranslate">
private void printDemoContent(){

		/*********** print head*******/
		String receiptHead = &quot;************************&quot;
				+ &quot;   P25/M Test Print&quot;+&quot;\n&quot;
				+ &quot;************************&quot;
				+ &quot;\n&quot;;

		long milis		= System.currentTimeMillis();

		String date		= DateUtil.timeMilisToString(milis, &quot;MMM dd, yyyy&quot;);
		String time		= DateUtil.timeMilisToString(milis, &quot;hh:mm a&quot;);

		String hwDevice	= Build.MANUFACTURER;
		String hwModel	= Build.MODEL;
		String osVer	= Build.VERSION.RELEASE;
		String sdkVer	= String.valueOf(Build.VERSION.SDK_INT);

		StringBuffer receiptHeadBuffer = new StringBuffer(100);

		receiptHeadBuffer.append(receiptHead);
		receiptHeadBuffer.append(Util.nameLeftValueRightJustify(date, time, DataConstants.RECEIPT_WIDTH) + &quot;\n&quot;);

		receiptHeadBuffer.append(Util.nameLeftValueRightJustify(&quot;Device:&quot;, hwDevice, DataConstants.RECEIPT_WIDTH) + &quot;\n&quot;);

		receiptHeadBuffer.append(Util.nameLeftValueRightJustify(&quot;Model:&quot;,  hwModel, DataConstants.RECEIPT_WIDTH) + &quot;\n&quot;);
		receiptHeadBuffer.append(Util.nameLeftValueRightJustify(&quot;OS ver:&quot;, osVer, DataConstants.RECEIPT_WIDTH) + &quot;\n&quot;);
		receiptHeadBuffer.append(Util.nameLeftValueRightJustify(&quot;SDK:&quot;, sdkVer, DataConstants.RECEIPT_WIDTH));
		receiptHead = receiptHeadBuffer.toString();

		byte[] header = Printer.printfont(receiptHead + &quot;\n&quot;, FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);

		/*********** print English text*******/
		StringBuffer sb = new StringBuffer();
		for(int i=1; i&lt;128; i++)
			sb.append((char)i);
		String content = sb.toString().trim();

		byte[] englishchartext24 			= Printer.printfont(content + &quot;\n&quot;,FontDefine.FONT_24PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);
		byte[] englishchartext32			= Printer.printfont(content + &quot;\n&quot;,FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);
		byte[] englishchartext24underline	= Printer.printfont(content + &quot;\n&quot;,FontDefine.FONT_24PX_UNDERLINE,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);

		//2D Bar Code
		byte[] barcode = StringUtil.hexStringToBytes(&quot;1d 6b 02 0d 36 39 30 31 32 33 34 35 36 37 38 39 32&quot;);

		/*********** print Tail*******/
		String receiptTail =  &quot;Test Completed&quot; + &quot;\n&quot;
				+ &quot;************************&quot; + &quot;\n&quot;;

		String receiptWeb =  &quot;** www.londatiga.net ** &quot; + &quot;\n\n\n&quot;;

		byte[] foot = Printer.printfont(receiptTail,FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);
		byte[] web	= Printer.printfont(receiptWeb,FontDefine.FONT_32PX,FontDefine.Align_CENTER,(byte)0x1A,PocketPos.LANGUAGE_ENGLISH);

		byte[] totladata =  new byte[header.length + englishchartext24.length + englishchartext32.length + englishchartext24underline.length +
		                              + barcode.length
		                             + foot.length + web.length
		                             ];
	 	int offset = 0;
		System.arraycopy(header, 0, totladata, offset, header.length);
		offset += header.length;

		System.arraycopy(englishchartext24, 0, totladata, offset, englishchartext24.length);
		offset+= englishchartext24.length;

		System.arraycopy(englishchartext32, 0, totladata, offset, englishchartext32.length);
		offset+=englishchartext32.length;

		System.arraycopy(englishchartext24underline, 0, totladata, offset, englishchartext24underline.length);
		offset+=englishchartext24underline.length;

		System.arraycopy(barcode, 0, totladata, offset, barcode.length);
		offset+=barcode.length;

		System.arraycopy(foot, 0, totladata, offset, foot.length);
		offset+=foot.length;

		System.arraycopy(web, 0, totladata, offset, web.length);
		offset+=web.length;

		byte[] senddata = PocketPos.FramePack(PocketPos.FRAME_TOF_PRINT, totladata, 0, totladata.length);

		sendData(senddata);
}
</pre>
<p>All bytes data to be printed is sent to printer using <em><span style="color: #008000;">sendData</span></em> method from <span style="color: #008000;">P25Connector</span> class (P25Connector.java)</p>
<pre class="brush: java; title: ; notranslate">
private void sendData(byte[] bytes) {
	try {
		mConnector.sendData(bytes);
	} catch (P25ConnectionException e) {
		e.printStackTrace();
	}
}
</pre>
<p>P25Connector is a wrapper class to handle bluetooth operation (connect, disconnect, and bluetooth socket operation)</p>
<p><strong>Demo video</strong></p>
<p><iframe  style="display: block; margin: 0px auto;"  id="_ytid_54134"  width="450" height="281"  data-origwidth="450" data-origheight="281"  src="https://www.youtube.com/embed/ZzrWVW6t1vk?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;modestbranding=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe></p>
<p><strong>Real life application video</strong></p>
<p><iframe  style="display: block; margin: 0px auto;"  id="_ytid_54388"  width="450" height="281"  data-origwidth="450" data-origheight="281"  src="https://www.youtube.com/embed/xkDWrdprg6g?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;modestbranding=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe></p>
<p>[ad#ad-720&#215;90]</p>
<p><a title="Github Repo" href="https://github.com/lorensiuswlt/P25Demo" target="_blank">Download source code from Github repo</a></p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/featured-articles/blue-bamboo-p25-printer-android-demo-application-with-source-code/">Blue Bamboo P25 Printer Android Demo Application With Source Code</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/featured-articles/blue-bamboo-p25-printer-android-demo-application-with-source-code/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
		<item>
		<title>How to Programmatically Pair or Unpair Android Bluetooth Device</title>
		<link>http://www.londatiga.net/it/programming/android/how-to-programmatically-pair-or-unpair-android-bluetooth-device/</link>
					<comments>http://www.londatiga.net/it/programming/android/how-to-programmatically-pair-or-unpair-android-bluetooth-device/#comments</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 15:41:07 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[pairing]]></category>
		<category><![CDATA[programmatically]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1268</guid>

					<description><![CDATA[<p>In bluetooth wireless communication, if two devices want to connect and share data, they have to be paired first. To be paired means the two devices are aware of each other&#8217;s existence and trusted each other.  Using Android Bluetooth API, we can use createBond method to pair with a device or removeBond to unpair. This  is [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/android/how-to-programmatically-pair-or-unpair-android-bluetooth-device/">How to Programmatically Pair or Unpair Android Bluetooth Device</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In <a href="http://www.londatiga.net/tag/bluetooth">bluetooth</a> wireless communication, if two devices want to connect and share data, they have to be paired first. To be paired means the two devices are aware of each other&#8217;s existence and trusted each other. <em></em></p>
<p>Using <a href="http://www.londatiga.net/category/it/programming/android/">Android</a> <a href="http://developer.android.com/guide/topics/connectivity/bluetooth.html">Bluetooth API</a>, we can use <span style="color: #008000;"><em>createBond</em></span> method to pair with a device or <em><span style="color: #008000;">removeBond </span></em><span style="color: #008000;"><span style="color: #000000;">to unpair</span></span>. This  is an asynchronous call so that it will return immediately. To catch the pairing process, we have to register a <a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html">BroadcastReceiver</a> with <em><span style="color: #008000;">ACTION_BOND_STATE_CHANGED</span></em> intent to catch the process.</p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_pair.png"><img loading="lazy" class="alignnone size-medium wp-image-1269" alt="android bluetooth pair" src="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_pair-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_pair-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_pair.png 200w" sizes="(max-width: 168px) 100vw, 168px" /></a>  <a href="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_device_list.png"><img loading="lazy" class="alignnone size-medium wp-image-1270" alt="android bluetooth device list" src="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_device_list-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_device_list-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_device_list.png 200w" sizes="(max-width: 168px) 100vw, 168px" /></a><br />
<span style="color: #0000ff;">(apk and source code at the bottom if this post)</span></p>
<p><strong>How to pair</strong></p>
<pre class="brush: java; title: ; notranslate">
private void pairDevice(BluetoothDevice device) {
        try {
            Method method = device.getClass().getMethod(&quot;createBond&quot;, (Class[]) null);
            method.invoke(device, (Object[]) null);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
</pre>
<p><strong>How to Unpair</strong></p>
<pre class="brush: java; title: ; notranslate">
private void unpairDevice(BluetoothDevice device) {
        try {
            Method method = device.getClass().getMethod(&quot;removeBond&quot;, (Class[]) null);
            method.invoke(device, (Object[]) null);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
</pre>
<p><strong>The receiver to catch the pairing process:</strong></p>
<pre class="brush: java; title: ; notranslate">
private final BroadcastReceiver mPairReceiver = new BroadcastReceiver() {
	    public void onReceive(Context context, Intent intent) {
	        String action = intent.getAction();

	        if (BluetoothDevice.ACTION_BOND_STATE_CHANGED.equals(action)) {
	        	 final int state 		= intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR);
	        	 final int prevState	= intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, BluetoothDevice.ERROR);

	        	 if (state == BluetoothDevice.BOND_BONDED &amp;&amp; prevState == BluetoothDevice.BOND_BONDING) {
	        		 showToast(&quot;Paired&quot;);
	        	 } else if (state == BluetoothDevice.BOND_NONE &amp;&amp; prevState == BluetoothDevice.BOND_BONDED){
	        		 showToast(&quot;Unpaired&quot;);
	        	 }

	        }
	    }
	};
</pre>
<p><strong>Register receiver</strong></p>
<pre class="brush: java; title: ; notranslate">
IntentFilter intent = new IntentFilter(BluetoothDevice.ACTION_BOND_STATE_CHANGED);
registerReceiver(mPairReceiver, intent);
</pre>
<p>For each changed state, the intent will carry extra fields <span style="color: #008000;"><em>EXTRA_BOND_STATE</em></span> and <em><span style="color: #008000;">EXTRA_PREVIOUS_BOND_STATE</span></em>. Using the value from the  extra fields we can determine the state of pairing process.</p>
<p>State paired if current state is <span style="color: #008000;"><em>BOND_BONDED</em></span> and previous state is <span style="color: #008000;"><em>BOND_BONDING</em></span>.<br />
State unpaired if current state is <em><span style="color: #008000;">BOND_NONE</span></em> and previous state is <em><span style="color: #008000;">BOND_BONDED<span style="color: #000000;">.</span></span></em></p>
<p><iframe  style="display: block; margin: 0px auto;"  id="_ytid_15728"  width="450" height="365"  data-origwidth="450" data-origheight="365"  src="https://www.youtube.com/embed/8U88w_2sefc?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;modestbranding=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe></p>
<p><a title="Github" href="https://github.com/lorensiuswlt/AndroBluetooth" target="_blank">Download the sample APK and source code from github</a></p>
<p>[ad#ad-720&#215;90]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/android/how-to-programmatically-pair-or-unpair-android-bluetooth-device/">How to Programmatically Pair or Unpair Android Bluetooth Device</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/programming/android/how-to-programmatically-pair-or-unpair-android-bluetooth-device/feed/</wfw:commentRss>
			<slash:comments>24</slash:comments>
		
		
			</item>
		<item>
		<title>How to Programmatically Scan or Discover Android Bluetooth Devices</title>
		<link>http://www.londatiga.net/it/programming/android/how-to-programmatically-scan-or-discover-android-bluetooth-device/</link>
					<comments>http://www.londatiga.net/it/programming/android/how-to-programmatically-scan-or-discover-android-bluetooth-device/#comments</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Thu, 20 Feb 2014 12:09:14 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[bluetooth]]></category>
		<category><![CDATA[discovery]]></category>
		<category><![CDATA[scanning]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1254</guid>

					<description><![CDATA[<p>Through Android Bluetooth API, developers can access most of bluetooth functionalities and let the applications wirelessly connect to bluetooth devices. Before connecting to a device, an application must discover or scan available bluetooth devices, request pairing and connect to the device.      (apk + source code at the bottom of this post) To discover [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/android/how-to-programmatically-scan-or-discover-android-bluetooth-device/">How to Programmatically Scan or Discover Android Bluetooth Devices</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Through <a href="http://www.londatiga.net/category/it/programming/android/">Android</a> <a href="http://developer.android.com/guide/topics/connectivity/bluetooth.html">Bluetooth API</a>, developers can access most of bluetooth functionalities and let the applications wirelessly connect to bluetooth devices. Before connecting to a device, an application must discover or scan available bluetooth devices, request pairing and connect to the device.</p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_discovery.png"><img loading="lazy" class="alignnone size-medium wp-image-1255" alt="android bluetooth discovery" src="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_discovery-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_discovery-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_discovery.png 200w" sizes="(max-width: 168px) 100vw, 168px" /></a>    <a href="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_scanning.png"><img loading="lazy" class="alignnone size-medium wp-image-1256" alt="android bluetooth scanning" src="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_scanning-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_scanning-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/android_bluetooth_scanning.png 200w" sizes="(max-width: 168px) 100vw, 168px" /></a></p>
<p><span style="color: #0000ff;">(apk + source code at the bottom of this post)</span></p>
<p>To discover a device, first get the bluetooth adapter by calling <em><span style="color: #339966;">BluetoothAdapter.getDefaultAdapter().</span></em><span style="color: #000000;"> </span></p>
<pre class="brush: java; title: ; notranslate">
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
</pre>
<p>To start discover, simply call the <span style="color: #339966;"><em>startDiscovery()</em> <span style="color: #000000;">from bluetooth adapter. This process is asynchronous so it will return immediately. To catch the discovery process, we can register a <a href="http://developer.android.com/reference/android/content/BroadcastReceiver.html">BroadcastReceiver</a> with <em>ACTION_FOUND</em>,  </span></span><em>ACTION_DISCOVERY_STARTED</em>,  <em>ACTION_DISCOVERY_STARTED. </em>For each device found, the intent will carry extra field  EXTRA_DEVICE containg the <a href="http://developer.android.com/reference/android/bluetooth/BluetoothDevice.html">BluetoothDevice</a> object.</p>
<pre class="brush: java; title: ; notranslate">
IntentFilter filter = new IntentFilter();

filter.addAction(BluetoothDevice.ACTION_FOUND);
filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);

registerReceiver(mReceiver, filter);
adapter.startDiscovery();
</pre>
<p>The receiver:</p>
<pre class="brush: java; title: ; notranslate">
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
	    public void onReceive(Context context, Intent intent) {
	        String action = intent.getAction();

	        if (BluetoothAdapter.ACTION_DISCOVERY_STARTED.equals(action)) {
	        	//discovery starts, we can show progress dialog or perform other tasks
	        } else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
	        	//discovery finishes, dismis progress dialog
	        } else if (BluetoothDevice.ACTION_FOUND.equals(action)) {
                       //bluetooth device found
	        	BluetoothDevice device = (BluetoothDevice) intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);

	        	showToast(&quot;Found device &quot; + device.getName());
	        }
	    }
	};
</pre>
<p>And, don&#8217;t forget to unregister the receiver on Activity&#8217;s onDestroy method:</p>
<pre class="brush: java; title: ; notranslate">
@Override
	public void onDestroy() {
		unregisterReceiver(mReceiver);

		super.onDestroy();
	}
</pre>
<p><iframe  style="display: block; margin: 0px auto;"  id="_ytid_90539"  width="450" height="365"  data-origwidth="450" data-origheight="365"  src="https://www.youtube.com/embed/8U88w_2sefc?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;modestbranding=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe></p>
<p><a title="Github" href="https://github.com/lorensiuswlt/AndroBluetooth" target="_blank">Download the sample APK and source code from github</a></p>
<p>[ad#ad-720&#215;90]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/android/how-to-programmatically-scan-or-discover-android-bluetooth-device/">How to Programmatically Scan or Discover Android Bluetooth Devices</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/programming/android/how-to-programmatically-scan-or-discover-android-bluetooth-device/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
			</item>
		<item>
		<title>How to Make Android ListView or GridView Expandable inside ScrollView</title>
		<link>http://www.londatiga.net/it/programming/android/make-android-listview-gridview-expandable-inside-scrollview/</link>
					<comments>http://www.londatiga.net/it/programming/android/make-android-listview-gridview-expandable-inside-scrollview/#comments</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Mon, 17 Feb 2014 11:39:46 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[expandable]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[listview]]></category>
		<category><![CDATA[scrollable]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1246</guid>

					<description><![CDATA[<p>We all know that placing a ListView or GridView inside ScrollView will make them becoming difficult to scroll and can not be expanded. Android doesn&#8217;t provide a built in API to handle this problem so we have to do a little hack by subclassing those two views. This is hack i found on stackoverflow, from [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/android/make-android-listview-gridview-expandable-inside-scrollview/">How to Make Android ListView or GridView Expandable inside ScrollView</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>We all know that placing a <a title="ListView" href="http://developer.android.com/guide/topics/ui/layout/listview.html">ListView</a> or <a title="GridView" href="http://developer.android.com/guide/topics/ui/layout/gridview.html" target="_blank">GridView</a> inside <a title="ScrollView" href="http://developer.android.com/reference/android/widget/ScrollView.html" target="_blank">ScrollView</a> will make them becoming difficult to scroll and can not be expanded. <a title="Android" href="http://www.londatiga.net/category/it/programming/android/" target="_blank">Android</a> doesn&#8217;t provide a built in API to handle this problem so we have to do a little hack by subclassing those two views.</p>
<p>This is hack i found on stackoverflow, from <a href="http://stackoverflow.com/questions/4523609/grid-of-images-inside-scrollview/4536955#4536955" target="_blank">Neil Traft</a> &#8216;s answer:</p>
<p><strong>ExpandableHeightListView</strong></p>
<pre class="brush: java; title: ; notranslate">
package net.londatiga.android.widget;

import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.ListView;
import android.content.Context;

public class ExpandableHeightListView extends ListView
{

boolean expanded = false;

public ExpandableHeightListView(Context context)
    {
        super(context);
    }

    public ExpandableHeightListView(Context context, AttributeSet attrs)
    {
        super(context, attrs);
    }

    public ExpandableHeightListView(Context context, AttributeSet attrs,
            int defStyle)
    {
        super(context, attrs, defStyle);
    }

    public boolean isExpanded()
    {
        return expanded;
    }

    @Override
    public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
    {
        // HACK! TAKE THAT ANDROID!
        if (isExpanded())
        {
            // Calculate entire height by providing a very large height hint.
            // But do not use the highest 2 bits of this integer; those are
            // reserved for the MeasureSpec mode.
            int expandSpec = MeasureSpec.makeMeasureSpec(
                    Integer.MAX_VALUE &gt;&gt; 2, MeasureSpec.AT_MOST);
            super.onMeasure(widthMeasureSpec, expandSpec);

            ViewGroup.LayoutParams params = getLayoutParams();
            params.height = getMeasuredHeight();
        }
        else
        {
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        }
    }

    public void setExpanded(boolean expanded)
    {
        this.expanded = expanded;
    }
}
</pre>
<p><strong>ExpandableHeightGridView</strong></p>
<pre class="brush: java; title: ; notranslate">
package net.londatiga.android.widget;

import android.util.AttributeSet;
import android.view.ViewGroup;
import android.widget.GridView;
import android.content.Context;

public class ExpandableHeightGridView extends GridView
{

 boolean expanded = false;

 public ExpandableHeightGridView(Context context)
 {
 super(context);
 }

 public ExpandableHeightGridView(Context context, AttributeSet attrs)
 {
 super(context, attrs);
 }

 public ExpandableHeightGridView(Context context, AttributeSet attrs,
 int defStyle)
 {
 super(context, attrs, defStyle);
 }

 public boolean isExpanded()
 {
 return expanded;
 }

 @Override
 public void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
 {
 // HACK! TAKE THAT ANDROID!
 if (isExpanded())
 {
 // Calculate entire height by providing a very large height hint.
 // But do not use the highest 2 bits of this integer; those are
 // reserved for the MeasureSpec mode.
 int expandSpec = MeasureSpec.makeMeasureSpec(
 Integer.MAX_VALUE &gt;&gt; 2, MeasureSpec.AT_MOST);
 super.onMeasure(widthMeasureSpec, expandSpec);

 ViewGroup.LayoutParams params = getLayoutParams();
 params.height = getMeasuredHeight();
 }
 else
 {
 super.onMeasure(widthMeasureSpec, heightMeasureSpec);
 }
 }

 public void setExpanded(boolean expanded)
 {
 this.expanded = expanded;
 }
}
</pre>
<p><strong>How to use:</strong></p>
<pre class="brush: java; title: ; notranslate">
//ListView
ExpandableHeightListView listView = new ExpandableHeightListView(this);

listView.setAdapter(adapter);
listView.setExpanded(true);

//GridView
ExpandableHeightGridView gridView = new ExpandableHeightGridView(this);

gridView.setNumColumns(4);
gridView.setAdapter(adapter);
gridView.setExpanded(true);
</pre>
<p>As you can see, to make the ListView or GridView expandable, just call the <span style="color: #339966;">setExapanded(true).</span></p>
<p><iframe  style="display: block; margin: 0px auto;"  id="_ytid_26765"  width="450" height="365"  data-origwidth="450" data-origheight="365"  src="https://www.youtube.com/embed/VLZGWkTsEdI?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;modestbranding=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="autoplay; encrypted-media" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe></p>
<p>[ad#ad-720&#215;90]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/programming/android/make-android-listview-gridview-expandable-inside-scrollview/">How to Make Android ListView or GridView Expandable inside ScrollView</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/programming/android/make-android-listview-gridview-expandable-inside-scrollview/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
			</item>
		<item>
		<title>New BBM for Android V2.0 is Out, Brings Channels, Voice, Location Sharing, Tons of New Emoticons, Larger Groups and More</title>
		<link>http://www.londatiga.net/it/gadget/android-gadget/new-bbm-android-v2-0-brings-channels-voice-location-sharing-tons-new-emoticons-larger-groups/</link>
					<comments>http://www.londatiga.net/it/gadget/android-gadget/new-bbm-android-v2-0-brings-channels-voice-location-sharing-tons-new-emoticons-larger-groups/#respond</comments>
		
		<dc:creator><![CDATA[Lorensius Londa]]></dc:creator>
		<pubDate>Sun, 16 Feb 2014 01:49:44 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[BBM]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[Channels]]></category>
		<category><![CDATA[Dropbox]]></category>
		<category><![CDATA[Groups]]></category>
		<category><![CDATA[location sharing]]></category>
		<category><![CDATA[Voice]]></category>
		<guid isPermaLink="false">http://www.londatiga.net/?p=1231</guid>

					<description><![CDATA[<p>Good news for BBM users, new version 2.0 is currently available on Google Store. This new update brings a lot of changes and new features. BBM Voice &#8211; Free voice calls between BBM contacts (Android, Blackberry, Iphone) BBM Channels &#8211; join conversations happening now with BBM users, brands, businesses, communities and more Faster and easier [&#8230;]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/gadget/android-gadget/new-bbm-android-v2-0-brings-channels-voice-location-sharing-tons-new-emoticons-larger-groups/">New BBM for Android V2.0 is Out, Brings Channels, Voice, Location Sharing, Tons of New Emoticons, Larger Groups and More</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Good news for <a title="Blackberry" href="http://www.londatiga.net/category/it/gadget/blackberry-gadget/" target="_blank">BBM</a> users, new version 2.0 is currently available on <a href="https://play.google.com/store/apps/details?id=com.bbm&amp;hl=en" target="_blank">Google Store</a>. This new update brings a lot of changes and new features.</p>
<ul>
<li>BBM Voice &#8211; Free voice calls between BBM contacts (Android, Blackberry, Iphone)</li>
<li>BBM Channels &#8211; join conversations happening now with BBM users, brands, businesses, communities and more</li>
<li>Faster and easier sharing,</li>
<li>Dropbox integration</li>
<li>Larger BBM groups, up to 50 users</li>
<li>Tons of new emoticons</li>
</ul>
<p><a href="https://play.google.com/store/apps/details?id=com.bbm&amp;hl=en" target="_blank"><img loading="lazy" class="alignnone size-medium wp-image-1193" alt="Download BBM on Googel Play" src="http://www.londatiga.net/wp-content/uploads/2011/08/android_app_on_google_play-300x99.jpg" width="300" height="99" srcset="http://www.londatiga.net/wp-content/uploads/2011/08/android_app_on_google_play-300x99.jpg 300w, http://www.londatiga.net/wp-content/uploads/2011/08/android_app_on_google_play.jpg 512w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_voice.png"><img loading="lazy" class="alignnone size-medium wp-image-1232" title="bbm voice" alt="bbm voice" src="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_voice-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_voice-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_voice-576x1024.png 576w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_voice.png 720w" sizes="(max-width: 168px) 100vw, 168px" /></a> <a href="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_channels.png"><img loading="lazy" class="alignnone size-medium wp-image-1233" title="bbm channels" alt="bbm channels" src="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_channels-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_channels-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_channels-576x1024.png 576w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_channels.png 720w" sizes="(max-width: 168px) 100vw, 168px" /></a> <a href="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_location_sharing.png"><img loading="lazy" class="alignnone size-medium wp-image-1234" title="bbm location sharing" alt="bbm location sharing" src="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_location_sharing-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_location_sharing-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_location_sharing-576x1024.png 576w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_location_sharing.png 720w" sizes="(max-width: 168px) 100vw, 168px" /></a></p>
<p><a href="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_side_menu.png"><img loading="lazy" class="alignnone size-medium wp-image-1235" title="bbm side menu" alt="bbm side menu" src="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_side_menu-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_side_menu-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_side_menu-576x1024.png 576w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_side_menu.png 720w" sizes="(max-width: 168px) 100vw, 168px" /></a> <a href="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_emoticons.png"><img loading="lazy" class="alignnone size-medium wp-image-1236" title="bbm emoticons" alt="bbm emoticons" src="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_emoticons-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_emoticons-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_emoticons-576x1024.png 576w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_emoticons.png 720w" sizes="(max-width: 168px) 100vw, 168px" /></a> <a href="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_dropbox.png"><img loading="lazy" class="alignnone size-medium wp-image-1237" title="bbm dropbox" alt="bbm dropbox" src="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_dropbox-168x300.png" width="168" height="300" srcset="http://www.londatiga.net/wp-content/uploads/2014/02/bbm_dropbox-168x300.png 168w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_dropbox-576x1024.png 576w, http://www.londatiga.net/wp-content/uploads/2014/02/bbm_dropbox.png 720w" sizes="(max-width: 168px) 100vw, 168px" /></a></p>
<p>[ad#ad-720&#215;90]</p>
<p>The post <a rel="nofollow" href="http://www.londatiga.net/it/gadget/android-gadget/new-bbm-android-v2-0-brings-channels-voice-location-sharing-tons-new-emoticons-larger-groups/">New BBM for Android V2.0 is Out, Brings Channels, Voice, Location Sharing, Tons of New Emoticons, Larger Groups and More</a> appeared first on <a rel="nofollow" href="http://www.londatiga.net">Lorenz Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://www.londatiga.net/it/gadget/android-gadget/new-bbm-android-v2-0-brings-channels-voice-location-sharing-tons-new-emoticons-larger-groups/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->