Just Simple Info

Pages

Android Send Email


Android send email

Sometimes our android application need to send email  for whatever reason.

So this time I going to post a simple code snippet on how android application can send email.
I make this code simple. No xml coding in this post.

CakePhp Pagination Issue with Group by Solution

It is easy to use in Cakephp it built in pagination in a simple way. But if you will try to use Group By keyword in querying your data. The pagination will return unexpected result. I have notice that the total number of data count is not correct. I Google about this issue, read a blogs and try to run all recommended solution and luckily I found a working one.

Android Upload File To Server With Data

Upload file to server with data and progress bar
Sometimes our android application need to upload some file to our live server like images, text files, etc.
Uploading file to server is one of my worst task. Searching, testing and searching, testing and again and again. I spent a lot of time just to upload the image to server. After a day, lucky I uploaded my first file to server. What I done is, I convert bitmap to byte[] then convert to Base64String then send to server as POST. But the size of original size increase which is not good. It consume extra bandwidth and time of uploading.

Android Use Sqlite Database Example


Almost all android application need database for storing data like username, password and other. Now we are going to write simple code on how to INSERT, UPDATE, DELETE and RETRIEVE data from database. The most popular database on mobile is the SqliteDatabase. So, this database we will going to used in this example.

Android StateListDrawable Example

StateListDrawable is android drawable that response on the current state of element (' pressed ',' focus', ' selected','etc').
Some element has default drawable that automatically change on press, focus, selected ,etc like Button, CheckBox, RadioButton. etc.

Android Custom ListView Adapter Example


ListView in android arrange views vertically scrollable automatically. If you want to display your items vertically and make it scrollable the ListView is the best choice but customizing ListView appearance get little tricky.

Now we are going to customize the background color and put icon on the left corner of each item.

CakePhp Pagination Example

Cake php pagination example
CakePhp pagination
In web application, displaying all data from database is not a good practice. It can affect the performance especially if we have a million or even a thousand of data. It will load the entire page in certain amount of time which is not good for the user experience.

Upload Image with Php and Javascript

Upload image using javascript and  jquery
I spend a lot of time to create a code that will upload image to server. Search and search and test that what I have to do to make such function worked. Luckily found something!!! Modify some codes and finally image uploaded to server. But every time I upload the whole page refresh.

Android TableLayout Example

Andtoid TableLayout created using xml
and
java code

TableLayout in android is a layout where children are arranged in columns and rows. This layout not provided borders in our table rows, cells and even in columns. So, we have to create for our own.

Android LinearLayout Example

LinearLayout in Android is a layout where children are vertically and horizontally aligned. The children are aligned base on layout orientation (vertical and horizontal). By default horizontal orientation is set. As you can see the image above, the children are horizontally aligned in gray background while green background children are vertically aligned. Like other layout we can also create LinearLayout by XML and Java code.

Android RelativeLayout Example

RelativeLayout
Black is created using xml
Green is created using java code
RelativeLayout in Android is most flexible layout. Children can be position almost anywhere or children view can position to the right, left, top and bottom of another children view. This layout is useful if you want to organize the content of your application the way you want. There are two way of creating RelativeLayout, by Xml and Java code.

Create view programmatically (TextView, Button, RelativeLayout and LinearLayout )

TextView, Button, RelativeLayout and LinearLayout
without the use of xml
Sometimes we want to create our view programmatically or without the use of xml.