<?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>assortmentofsites</title>
	<atom:link href="https://assortmentofsites.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://assortmentofsites.com</link>
	<description>Just another Assortmentofsites</description>
	<lastBuildDate>Wed, 02 Jun 2021 23:51:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>looks different but is&#8217;t the same</title>
		<link>https://assortmentofsites.com/looks-different-but-ist-the-same/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=looks-different-but-ist-the-same</link>
		<comments>https://assortmentofsites.com/looks-different-but-ist-the-same/#comments</comments>
		<pubDate>Wed, 09 Nov 2016 22:21:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">https://assortmentofsites.com/?p=845</guid>
		<description><![CDATA[- life difficulty is same for every one - life happiness is same for every one - if there was no heaven would you still do the right things, would your definition of right and wrung change]]></description>
			<content:encoded><![CDATA[<p>- life difficulty is same for every one</p>
<p>- life happiness is same for every one</p>
<p>- if there was no heaven would you still do the right things, would your definition of right and wrung change</p>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/looks-different-but-ist-the-same/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Static Llibrary for Android app</title>
		<link>https://assortmentofsites.com/creating-static-llibrary-for-android-app/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=creating-static-llibrary-for-android-app</link>
		<comments>https://assortmentofsites.com/creating-static-llibrary-for-android-app/#comments</comments>
		<pubDate>Mon, 25 Jan 2016 07:40:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=820</guid>
		<description><![CDATA[Environment This project has been done on windows 7 using NetBeans as the IDE of choice. Am using ant scripts to build the project. Am NOT using cygwin or mini cygwin. I found this installations to be too bulky and i really avoided them. Requirements Android SDK  Android NDK An IDE (Integrated development environment) of [...]]]></description>
			<content:encoded><![CDATA[<h2>Environment</h2>
<p>This project has been done on windows 7 using NetBeans as the IDE of choice.</p>
<p>Am using ant scripts to build the project.</p>
<p>Am NOT using <strong>cygwin</strong> or mini <strong>cygwin</strong>. I found this installations to be too bulky and i really avoided them.</p>
<h2>Requirements</h2>
<ul>
<li><a title="Android SDK" href="http://developer.android.com/sdk/index.html">Android SDK</a></li>
<li><a title="Android SDK" href="http://developer.android.com/sdk/index.html"> </a><a title="Android NDK" href="http://developer.android.com/ndk/downloads/index.html">Android NDK</a></li>
<li>An IDE (Integrated development environment) of your choice.</li>
</ul>
<h3>Set the following Environment Variables.</h3>
<ul>
<li>name: ANDROID_HOME  value: &lt;sdk path e.g C:\android\android-sdk&gt;</li>
<li>name: ANDROID_SDK_HOME value: &lt;sdk path e.g C:\android\android-sdk&gt;</li>
<li>name: ANDROID_NDK_ROOT value: &lt;ndk path e.g C:\android\android-ndk-r10e&gt;</li>
<li>name: NDK_HOME  value: &lt;ndk path e.g C:\android\android-ndk-r10e&gt;</li>
<li>name: JAVA_HOME  value: &lt;jdk path e.g D:\Program Files\Java\jdk1.7.0_17&gt;</li>
<li>(optional) set this if you are building with ant.   name: ANT_HOME  value: &lt;ant path e.g C:\Users\somename\AppData\Roaming\NetBeans\7.3.1\ant&gt;</li>
<li>this will be used by the tool chain (increasing memory limits) .   name: _JAVA_OPTIONS value: -Xms256m -Xmx512m</li>
<li>name: PATH value: (append the following to your current path value using semi colon (;) as a separator) &lt;sdk path&gt;\platform-tools;&lt;ndk path&gt;;&lt;jdk path&gt;\bin</li>
</ul>
<p>Create new android project in you IDE. (give it any name e.g hello_ndk)</p>
<h3>sample code for MainActivity as follows:</h3>
<code>
<pre class="brush: java"> package com.hndk;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;gt;&amp;amp;amp;lt;/code&amp;amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/code&gt;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {

native String helloStringFromJNI();

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
final TextView tvText = (TextView) this.findViewById(R.id.tvText);
Button btgetnative = (Button) this.findViewById(R.id.btcall_native);
btgetnative.setOnClickListener(new Button.OnClickListener() {
public void onClick(View v) {
tvText.setText(helloStringFromJNI());
}
});
}

static {
System.loadLibrary(&quot;hello-jni&quot;);
}
}
</pre>
<p>Note: function helloStringFromJNI() has been declared as native, this is a keyword that says we want to call a function that has been implemented in a native code  library  (C language).</p>
<p>also note how we use the keyword static and the function System.loadLibrary("some library"), to load the library.</p>
<p>some library is just the name of the library without the extension. The Extension .so or .a is added automatically on compiling.</p>
<h3>sample code for the UI main.xml</h3>
<code>
<pre class="brush: xml">&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
android:orientation=&quot;vertical&quot;
android:layout_width=&quot;fill_parent&quot;
android:layout_height=&quot;fill_parent&quot;
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;TextView
android:id=&quot;@+id/tvText&quot;
android:layout_width=&quot;fill_parent&quot;
android:layout_height=&quot;wrap_content&quot;
android:text=&quot;Hello World, MainActivity&quot;
/&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;Button
android:id=&quot;@+id/btcall_native&quot;
android:text=&quot;run native&quot;
android:padding=&quot;3dp&quot;
/&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;
&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/LinearLayout&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;amp;amp;gt;&amp;amp;amp;amp;amp;lt;/code&amp;amp;amp;amp;amp;gt;&amp;amp;amp;lt;/code&amp;amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/code&gt;

</pre>
<p>Now build you android code.</p>
<p>after successfully building,   you run the following commands in command prompt window.</p>
<p>Change directory to the location of <strong>your built classes</strong> e.g</p>
<h5>cd &lt;your project folder location&gt;\bin\classes\</h5>
<span style="color: #0000ff;">Call javah to build your header file as follows (<strong> if you are using NativeApp class</strong>).</span>
<strong>javah -jni &lt;fully qualified package name&gt;.&lt;you class name&gt;</strong>
<p>e.g javah -jni com.hndk.MainActivity</p>
<p>you can also use the full path to javah location as follows.</p>
<strong> &lt;path to jdk&gt;\bin\javah.exe -jni &lt;fully qualified package name&gt;.&lt;you class name&gt;</strong>
<p>&nbsp;</p>
<span style="color: #0000ff;">Call javah to build your header file as follows (<strong> if you are using  normal Activity class e.g <strong>MainActivity </strong></strong>).</span>
<p>&nbsp;</p>
<strong>javah  -classpath &lt;path to platform you are supporting&gt; -jni &lt;fully qualified package name&gt;.&lt;you class name&gt;</strong>
<p>e.g javah -classpath "&lt;path to sdk&gt;\platforms\android-8\android.jar"; -jni com.hndk.MainActivity</p>
<p>or</p>
<p>&lt;path to jdk&gt;\bin\javah.exe -classpath "&lt;path to sdk&gt;\platforms\android-8\android.jar"; -jni com.hndk.MainActivity</p>
<strong></strong>On success your output header file will be located in &lt;your project folder location&gt;\bin\classes\</p>
<p>Create a new folder called JNI in you project root folder. Copy the generated C header file to this new folder.</p>
<p>In the sane folder create a file called <a title="about make file" href="http://android.mk/">Android.mk</a>. Add the following to the file</p>
<code>[sourcecode language=assembly]<br />
LOCAL_PATH := $(call my-dir)</code>
<p>include $(CLEAR_VARS)</p>
<p>LOCAL_MODULE := hello_ndk /*any unique name without spaces*/<br />
LOCAL_SRC_FILES := hello_ndk.cpp</p>
<p>include $(BUILD_STATIC_LIBRARY)<br />
[/sourcecode]<br />
also add a file called hello_ndk.cpp . This file will have the following code (it is our LOCAL_SRC_FILES above)<br />
<code>
<pre class="brush: xml">
// hello_ndk.cpp&amp;amp;amp;lt;/code&amp;amp;amp;gt;&amp;lt;/code&amp;gt;&lt;/code&gt;

#include &quot;com_hndk_MainActivity.h&quot;

jstring
Java_com_hndk_MainActivity_helloStringFromJNI( JNIEnv* env, jobject thiz )
{
// (*env)-&amp;amp;amp;amp;amp;amp;amp;gt;ReleaseStringUTFChars(env, s, str);
// env-&amp;amp;amp;amp;amp;amp;amp;gt;ReleaseStringUTFChars(s, str);
return env-&amp;amp;amp;amp;amp;amp;amp;gt;NewStringUTF(&quot;Hello World from JNI! yepeee&quot;);
}
</pre>
<p>&nbsp;</p>
<h2>Now building the c++ library</h2>
<p>dowload the following resorces :</p>
<ul>
<li><a title="cmake" href="https://github.com/taka-no-me/android-cmake">android cmake</a></li>
<li><a title="cmake.exe" href="https://cmake.org/download/">cmake executable</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/creating-static-llibrary-for-android-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title></title>
		<link>https://assortmentofsites.com/814/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=814</link>
		<comments>https://assortmentofsites.com/814/#comments</comments>
		<pubDate>Wed, 30 Sep 2015 14:37:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=814</guid>
		<description><![CDATA[This app was written because I was running out of internal memory in my phone. (unable to install other apps as a result) Most of this memory was being consumed by WhatsApp media. Since there is no way to set WhatsApp to save the media to the external SD card. One may manually move the [...]]]></description>
			<content:encoded><![CDATA[<p>This app was written because I was running out of internal memory in my phone. (unable to install other apps as a result)<br />
Most of this memory was being consumed by WhatsApp media.<br />
Since there is no way to set WhatsApp to save the media to the external SD card. One may manually move the files, however this is a very boring and complicated task.<br />
Most of the solutions to handle this require a rooted phone.</p>
<a title="Move WhatsApp media" href="http://assortmentofsites.com/app/MoveWhatsappMedia-release.apk">MoveWhatsappMedia </a>app automates this for you, no need to root your phone.<br />
You just need to set the number of days such that any media (audio, video, images) older than the specified days, will be moved to the external memory (removable SD card which is normally has more space)</p>
<h2><a title="Move WhatsApp media" href="http://assortmentofsites.com/app/MoveWhatsappMedia-release.apk">DOWNLOAD MoveWhatsappMedia</a> (Size 10Kb)</h2>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/814/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Move WhatsApp Media to External Memory</title>
		<link>https://assortmentofsites.com/move-whatsapp-media-to-external/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=move-whatsapp-media-to-external</link>
		<comments>https://assortmentofsites.com/move-whatsapp-media-to-external/#comments</comments>
		<pubDate>Wed, 30 Sep 2015 14:36:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=812</guid>
		<description><![CDATA[This app was written because I was running out of internal memory in my phone. (unable to install other apps as a result) Most of this memory was being consumed by WhatsApp media. Since there is no way to set WhatsApp to save the media to the external SD card. One may manually move the [...]]]></description>
			<content:encoded><![CDATA[<p>This app was written because I was running out of internal memory in my phone. (unable to install other apps as a result)<br />
Most of this memory was being consumed by WhatsApp media.<br />
Since there is no way to set WhatsApp to save the media to the external SD card. One may manually move the files, however this is a very boring and complicated task.<br />
Most of the solutions to handle this require a rooted phone.</p>
<a title="Move WhatsApp media" href="http://assortmentofsites.com/app/MoveWhatsappMedia-release.apk">MoveWhatsappMedia </a>app automates this for you, no need to root your phone.<br />
You just need to set the number of days such that any media (audio, video, images) older than the specified days, will be moved to the external memory (removable SD card which is normally has more space)</p>
<h2><a title="Move WhatsApp media" href="http://assortmentofsites.com/app/MoveWhatsappMedia-release.apk">DOWNLOAD MoveWhatsappMedia</a> (Size 10Kb)</h2>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/move-whatsapp-media-to-external/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>get-a-payoneer-debit-card</title>
		<link>https://assortmentofsites.com/get-a-payoneer-debit-card/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=get-a-payoneer-debit-card</link>
		<comments>https://assortmentofsites.com/get-a-payoneer-debit-card/#comments</comments>
		<pubDate>Sun, 27 Sep 2015 16:44:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=809</guid>
		<description><![CDATA[card]]></description>
			<content:encoded><![CDATA[<p>card</p>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/get-a-payoneer-debit-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android sqllite csv to database</title>
		<link>https://assortmentofsites.com/android-sqllite-csv-to-database/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=android-sqllite-csv-to-database</link>
		<comments>https://assortmentofsites.com/android-sqllite-csv-to-database/#comments</comments>
		<pubDate>Wed, 11 Jun 2014 08:49:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=785</guid>
		<description><![CDATA[to import data from a CSV file into an android database, use the following code Note: set your csv file name to match your database table name public boolean csvTodatabase() { FileStuff f = new FileStuff(); //check if extarnal drive is readerble if (!f.isExternalStorageReadable()) { f.fileError = &#34;can not read external storage&#34;; f.fileinfo = &#34;Please [...]]]></description>
			<content:encoded><![CDATA[<p>to import data from a CSV file into an android database, use the following code</p>
<p>Note: set your csv file name to match your database table name</p>
<pre class="brush: java">

public boolean csvTodatabase() {
FileStuff f = new FileStuff();
//check if extarnal drive is readerble
if (!f.isExternalStorageReadable()) {
f.fileError = &quot;can not read external storage&quot;;
f.fileinfo = &quot;Please remount your SD card&quot;;
return false;
}
//get all files from extarnal drive data directory
ArrayList&lt;File&gt; files = new ArrayList&lt;File&gt;();
File directory = new File(FileStuff.DATA_DIRECTORY);
if (!directory.exists()) {
return false;
}
File[] fList = directory.listFiles();
for (File file : fList) {
if (file.isFile()) {
files.add(file);
}
}
for (File csvfile : files) {
readFromFile(csvfile);
}
return true;
}

private void readFromFile(File file) {
boolean gotColunms = false;
String tableName = file.getName().replaceAll(&quot;.csv$&quot;, &quot;&quot;), sql, colunmNames=&quot;&quot;,colunmValues;
try {
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
SQLiteDatabase database = this.getWritableDatabase();
while ((line = br.readLine()) != null) {
if (!gotColunms) {
//get colunm names
line = line.replaceAll(&quot;\&quot;&quot;, &quot;&quot;);
colunmNames = line;
gotColunms = true;//set flag to show we have colunms
} else {
line = line.replaceAll(&quot;\&quot;&quot;, &quot;&#039;&quot;);
colunmValues =  line;
//create sql query
sql = &quot;INSERT INTO &quot; + tableName + &quot; (&quot;+colunmNames+&quot;) VALUES (&quot;+colunmValues+&quot;)&quot;;
//update datebase tables
database.execSQL(sql);
}
}
database.close();
br.close();
} catch (IOException e) {
//You&#039;ll need to add proper error handling here
}
}

&amp;amp;amp;amp;amp;nbsp;

</pre>
<p>any CSV file found in the data directory, will be read and the records will be inserted into the corresponding table whose name is similar to the file name. E.G. if you have a file called table_one.csv the records will be added into a database table called table_one. make sure that this table already exists in the database</p>
<p>look for code on how to create the CSV <a title="android database table to csv" href="http://assortmentofsites.com/android-sqllite-table-to-csv/">here</a>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/android-sqllite-csv-to-database/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Android sqllite table to csv</title>
		<link>https://assortmentofsites.com/android-sqllite-table-to-csv/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=android-sqllite-table-to-csv</link>
		<comments>https://assortmentofsites.com/android-sqllite-table-to-csv/#comments</comments>
		<pubDate>Tue, 10 Jun 2014 18:14:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=782</guid>
		<description><![CDATA[to convert any table to csv use the code below. public boolean createCsvSaveToFile(Cursor cursor, String fileName) throws IOException { String csv = &#34;&#34;; int colunmCount = cursor.getColumnCount(), i; //check if extarnal drive is readerble if (!isExternalStorageWritable()) { fileError = &#34;can not save to external storage&#34;; fileinfo = &#34;Please mount your SD card&#34;; return false; } [...]]]></description>
			<content:encoded><![CDATA[<p>to convert any table to csv use the code below.</p>
<pre class="brush: java">

public boolean createCsvSaveToFile(Cursor cursor, String fileName) throws IOException {
String csv = &quot;&quot;;
int colunmCount = cursor.getColumnCount(), i;
//check if extarnal drive is readerble
if (!isExternalStorageWritable()) {
fileError = &quot;can not save to external storage&quot;;
fileinfo = &quot;Please mount your SD card&quot;;
return false;
}
//create CSV
for (i = 0; i &amp;amp;amp;amp;amp;lt; colunmCount; i++) {//GET COLUNM NAMES
csv += QUOTES + cursor.getColumnName(i).toString() + QUOTES + INNER_DELIMITER;
}
csv = csv.replaceAll(&quot;,$&quot;, &quot;&quot;);
csv += LINE_END;
if (cursor.moveToFirst()) {
do {
for (i = 0; i &amp;amp;amp;amp;amp;lt; colunmCount; i++) {//GET COLUNM values
csv += QUOTES + cursor.getString(i) + QUOTES + INNER_DELIMITER;
}
csv = csv.replaceAll(&quot;,$&quot;, &quot;&quot;);
csv += LINE_END;
} while (cursor.moveToNext());
}
//save file
File file = getDataDir(fileName);
FileOutputStream out = new FileOutputStream(file);
out.write(csv.getBytes());
out.flush();
out.close();
return true;
}

&amp;amp;amp;amp;amp;nbsp;

private boolean isExternalStorageWritable() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
return true;
}
return false;
}

/* Create data dir or return it */
private File getDataDir(String tableCsv) throws IOException {
// Get the directory for the app data directory.
String f = tableCsv + &quot;.csv&quot;;
File dataDirectory = new File(DATA_DIRECTORY, f);
if (!dataDirectory.exists()) {
if (!dataDirectory.createNewFile()) {
Log.e(&quot;getStorageDir&quot;, &quot;file &quot; + f + &quot; not created&quot;);
fileError = &quot;file &quot; + f + &quot; not created&quot;;
fileinfo = &quot;unable to create backup file&quot;;
return null;
}
}
return dataDirectory;
}

</pre>
<p>just create a cursor with the appropriate data and call the function</p>
<p>you may set the file name to match the table name</p>
<p>look for code on how to add records into the android database from CSV <a title="android csv to database" href="http://assortmentofsites.com/android-sqllite-csv-to-database/">here</a>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/android-sqllite-table-to-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android radio button set mulptiple values</title>
		<link>https://assortmentofsites.com/android-radio-button-set-mulptiple-values/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=android-radio-button-set-mulptiple-values</link>
		<comments>https://assortmentofsites.com/android-radio-button-set-mulptiple-values/#comments</comments>
		<pubDate>Thu, 05 Jun 2014 13:20:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=775</guid>
		<description><![CDATA[As i was working on an android app i released that i needed a radio button whose value was different from the display text. This is because the display text can be in any of several languages i.e Chinese, french, Japanese etc. i extended the radio button class as below import android.content.Context; import android.util.AttributeSet; import [...]]]></description>
			<content:encoded><![CDATA[<p>As i was working on an android app i released that i needed a radio button whose value was different from the display text. This is because the display text can be in any of several languages i.e Chinese, french, Japanese etc.</p>
<p>i extended the radio button class as below</p>
<pre class="brush: java">
import android.content.Context;
import android.util.AttributeSet;
import android.widget.RadioButton;

/**
*
* @author assortmentofsites
*/
public class multivalueRadioButton extends RadioButton{
String value;
String auxvalue;
public multivalueRadioButton(Context context) {
super(context);
}

public multivalueRadioButton(Context context, AttributeSet attrs) {
super(context, attrs);
}

public multivalueRadioButton(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public void setValue(String v) { this.value = v; }
public String getValue() { return this.value; }
public void setAuxValue(String v) { this.auxvalue = v; }
public String getAuxValue() { return this.auxvalue; }
}
</pre>
<p>the custom radio button &#8220;multivalueRadioButto&#8221; can captuer two extra vales i.e value and  auxvalue</p>
<p>you can save the code in a file like &#8220;multivalueRadioButton.java&#8221;</p>
<p>Usage:</p>
<p>if you are getting data from a database and creating the custom radio buttons on the fly you can use a function like one below:</p>
<pre class="brush: java">

private RadioGroup inflateRg(RadioGroup rg, Cursor cursor) {

if (cursor.moveToFirst()) {
int i = 0;
do {
multivalueRadioButton rdbtn = new multivalueRadioButton(context);
rdbtn.setId(cursor.getInt(0)); //radio button id
rdbtn.setText(cursor.getString(1));//radio button name
rdbtn.setValue(cursor.getString(0));//extra value
rg.addView(rdbtn, i);
i++;
} while (cursor.moveToNext());
}
return rg;
}

</pre>
<p>simply get the data from the database into a cursor, call this function and you will have your radio group populated <img src='https://assortmentofsites.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/android-radio-button-set-mulptiple-values/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pinterest not picking featured Image</title>
		<link>https://assortmentofsites.com/pinterest-not-picking-featured-image/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pinterest-not-picking-featured-image</link>
		<comments>https://assortmentofsites.com/pinterest-not-picking-featured-image/#comments</comments>
		<pubDate>Tue, 30 Apr 2013 08:27:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=710</guid>
		<description><![CDATA[&#160; i had installed pinterest for a client and after sometime the client noticed that on pining, pinterest was not picking the featured image. i spent many hours going through the plugging code trying to find out the cause. When all had failed i noticed that the only images being picked from the page, were [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>i had installed pinterest for a client and after sometime the client noticed that on pining, pinterest was not picking the featured image.<br />
i spent many hours going through the plugging code trying to find out the cause. When all had failed i noticed that the only images being picked from the page, were relatively large in size.<br />
So i added a large size of the featured image into the post and to my surprise, it was picked by pinterest.<br />
since this image was out of place, the only thing i had to do was to hide it.<br />
the code below shows how i did it. you can add it to your theme files</p>
<pre class="brush: php">
global $post;
	$pcategory = get_the_category($post-&gt;ID);
	if($pcategory[0]-&gt;name == &#039;Recipe&#039;){
		$meta = get_post_custom($post-&gt;ID);
		$photo_id = $meta[&#039;photo&#039;][0];
		$photo = wp_get_attachment_image($photo_id, &#039;large&#039;, false, $attr);
		$photo = disect_page(&#039;src=&quot;&#039;, &#039;&quot; class=&#039;, $photo, array(&#039;en_offset&#039;=&gt;0));
		$photo = str_replace(&#039;src=&quot;&#039;, &#039;&#039;, $photo);
	}
</pre>
<p>there are many ways to get the path to the featured image, the code above is just one of them</p>
<pre class="brush: html">

&lt;img src=&quot;&lt;?php echo $photo?&gt;&quot; style=&quot;opacity:0; position:absolute; top:0; left:0; filter:alpha(opacity=0);&quot; /&gt;

</pre>
<p>&nbsp;</p>
<p>add the above html at any place in your post template.  $photo contains the path to your image</p>
<p>the  style in the img tag, ensures that the image is not visible in any browser, even older versions of Internet explorer.</p>
<strong>you do not need</strong> this hack if you featured image is of the right size on displaying the post.</p>
<p>if you displayed featured image is <strong>small to the extent that pinterest does not pick it</strong>, use the code above to add a hidden larger version and pinterest will pick this.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/pinterest-not-picking-featured-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>remove double underlined green advertising links</title>
		<link>https://assortmentofsites.com/remove-double-underlined-green-advertising-links/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remove-double-underlined-green-advertising-links</link>
		<comments>https://assortmentofsites.com/remove-double-underlined-green-advertising-links/#comments</comments>
		<pubDate>Sun, 05 Aug 2012 06:18:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://assortmentofsites.com/?p=664</guid>
		<description><![CDATA[To remove the annoying,  irritating, nauseating,  intrusive, repulsive, aggravating  double underlined green advertising links from Google Chrome. Go to tools -&#62; settings select extensions. Disable all the extensions then enable them one by one,  while testing until you identify which extension is responsible for this awfully awful behaviour. On identifying the culprit please use all methods [...]]]></description>
			<content:encoded><![CDATA[<p>To remove the annoying,  irritating, nauseating,  intrusive, repulsive, aggravating  double underlined green advertising links from Google Chrome. Go to tools -&gt; settings select extensions. Disable all the extensions then enable them one by one,  while testing until you identify which extension is responsible for this awfully awful behaviour.</p>
<p>On identifying the culprit please use all methods at your disposal to annihilate, obliterate and destroy this pain in the etc</p>
<p>or simply delete it</p>
<p>thank you</p>
]]></content:encoded>
			<wfw:commentRss>https://assortmentofsites.com/remove-double-underlined-green-advertising-links/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
	</channel>
</rss>
