Hdelossantos.com

Home

This website serves as the platform for my professional work, and includes my resume and samples of previous accomplishments, it also serves as a blog. Hdelossantos. com outlines my professional and life experience as I try to adapt to life in the mid-west. Additionally, it also serves to give insight into my interests and hobbies.



Using a SQLite Database in Android

by Hanly on Jan.07, 2010, under Tutorials

This tutorial will demonstrate how to use the database adapter created in "Creating a SQLite Database in Android" to add and get data to and from the database to populate a ListView. DatabaseQuery.java : We must first create a class to handle the formatting for the queries. The database adapter takes ArrayLists of String objetcs to add rows to the database, however you will probably want a method to add one cell at a time, then when the contents of the row are completed, add the entire row to the database. We begin by declaring the variables for the ArrayLists. import java.util.ArrayList; import android.content.Context; import android.database.Cursor; /** * This class adds multiple entries to the database and pulls them back * out. */ public class DatabaseQuery ...

(continue reading...)

2 Comments :, , , , , , , , more...

Quick and easy Android HTTP POST of JSON string

by Hanly on Dec.24, 2009, under Tutorials

There are several ways to send data across the internet to a server on the Android. I was recently working on a project and needed to send a JSON string to the server to add data to a database. Additionally in certain cases I wanted to receive data back from the server. The fastest and easiest way to do this was to use HTTP POST android library and capture the response from the server using a response handler. On the server side the response was simply generated by echoing a JSON string. public ArrayList<String> getServerData() throws JSONException, ClientProtocolException, IOException { ArrayList<String> stringData = new ArrayList<String>(); DefaultHttpClient httpClient = new DefaultHttpClient(); ResponseHandler <String> resonseHandler = new BasicResponseHandler(); HttpPost ...

(continue reading...)

1 Comment :, , , , , , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...