Just Simple Info

Pages

Upload File to Server With Extra String Data In Android




I developing android application that need to upload images in server using okhttp3 library.
This library work great with small amount of time writing code. Then suddenly my internet connection get worst. I thought my application not working because no server response for almost a minute. Luckily android studio has great tool for debugging. I notice that my application have network activity therefore the android application is working.

So I write simple code to show uploading progress to notify user what happening.

Android Simple Login with Php and Mysql



Android Simple Login with Php and Mysql
Must android application required connection in cloud server. So I wrote this simple code to share an idea on how to create simple login in android application connected to server using PHP and Mysql database and OkHttp library.

Android as Web Server

set android as web server


This sample code is about how to set android device as your web server on local network.
It may use to develop android application which need to transfer file from your laptop or desktop without need of any application in client side just a browser.

Save AES encypted object as file in android storage

Sometimes android application need to save some data in device storage.
It is not a good practice that data in file is human readable.

So, now I going to share simple code to save file encrpyted AES ecrypted.

Enable internet connection in CentOs 7 installed in virtualbox

I have having hard time to enable internet connection in CentOs 7 installed in VirtualBox.
When I execute command 'ping google.com' the output is 'ping: unknown host google.com'.

Now I will share the steps on how to enable the internet connection in virtulabox.

Hope it helps...

1. Right click the installed CentOs in virtualbox and select settings. In next window select Network then just copy setting like in image below.


Search Auto Suggest In Android (AutoCompleteTextView)



AutoCompleteTextView in one of the most important android view for user experience. Imagine your application has ListView with hundred of item display. It’s hard for users to find the item they want to see.

Thanks for AutoCompleteTextView, users will just type the chunk of word of item they want to see the AutoCompleteTextView will just display items based on what user type in.

Speed up Large Data Insertion in Sqlite Database in Android Application


Speed up large data insertion in sqlite database in android application

In my android project I need to insert large data in sqlite database. Inserting 20000 lines of data using ContentValues is not a good idea in term of speed of insertion. It's take more than a minute.

Android Calling Javascript function from Java function and Javascript function to Java function in Webview.

Good day coders..

I will share a simple code snippet on how to call Javascript function from android Java function and
Javascript function to android Java function in webview.

Actually it is easy to implement this such function. I think the hardest thing in this is, It's hard to debug. If you have error in javascript the logcat will not show any error it will not just worked.
So, you have to guess what is/are the possible error in the code.

Android Scrolling Table with Fixed Header Column, Fixed Row , Header Spans and Pagination

Hello coders, I will share another android code.

Sometimes programmer need to customize the layout of application they are developing.
Like what I have experienced a couple month in developing android application.

I need to develop android table with fixed header column and fixed row.
Android has Table kind of element but it just a table like in Html, no fixed header and row.
Search... search... search and search, but there is nothing such table with fixed header column and fixed row.

I figured out that, that I have to do it by my self.


Watch the actual result.


Android get Latitude, Longitude and Location Accuracy using Gps and Network.

Hello Friends, every android phone has ability to get your current location via Gps or Network.
This post is simple yet effective to get your current location using Gps and Network.

Gps provide the most accurate coordinates not like network but sometimes network does.
By the way, android also give as  how possible far we are in given position.
It's called the Accuracy. The smallest number of accuracy the most accurate location.

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.