background preloader

Phone

Facebook Twitter

Send and Recive Parameter with Android To Mysql PHP. ------------------------------------------------------------------------- PHP code for receiving data: ------------------------------------------------------------------------- $hostname_localhost ="localhost"; $database_localhost ="mydatabase"; $username_localhost ="root"; $password_localhost =""; $localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db("Deal"); $sql=mysql_query("select * from CITY where CITY_NAME like 'A%'"); while($row=mysql_fetch_assoc($sql)) $output[]=$row; print(json_encode($output)); mysql_close(); ?

> ------------------------------------------------------------------------- java code for Insert data: ------------------------------------------------------------------------- ------------------------------------------------------------------------- PHP code for Insert data: ------------------------------------------------------------------------- ********************Add. My First Android App. Download source - 411.2 KB Introduction Most of the tutorials starts with "Hello World" applications for beginners to start with. In this article, I have jumped a step forward to come up with a bundle of tutorials which I hope will be useful for Android developers (beginners) to start with. The application is a simple Job Search. From an Android phone, the user can search for jobs in a Job website (ASP.NET website) based on user current location (using GPS) and Job Location.

The user will enter the search keyword and the number of miles and he will get all the jobs within the distance he entered based on his current location. The application will cover the following tutorials: Tools and IDEs Here are the tools and IDEs used to develop the above application: Android SKD: Development kit for Android including emulator. Server Side Code First of all, let me explain the hosted web service with the database table that contains the Jobs Adverts records. Create FUNCTION [dbo]. Client Side Code. Send email with attachment in Android. Imagine you are implementing a program for a sales rep that has to print an invoice (reciept) when he is with the client. There is no wifi printer or connection with a local network. A solution that comes to mind is to send the invoice to the client by email and then he can print it locally.

We will create a function to create the HTML file (invoice file) and save the HTML to an SD card. Note that you have to change the code regarding the invoice details, I just put a sample: Now we need code to fire the sending event. You can add a test box (Edit view) to the activity to let the user write the address and subject, we will use a static variable with fixed variables. Hamdy Ghanem Senior Software Engineer / System Architect Experience: +11 years hamdy.ghanem@gmail.com Graduated from Munifia University, faculty of science, Math and computer science department May 1999 Experience Brief 11+ years of experience in software development field.

Send and receive JSON between Android and PHP web service. Introduction You are creating an Android app and want to read data from a MySQL database and send data. We will create a Web Service in PHP, read from the MySQL database, and let the Android connect with the Web Service and send data, and the Web Service will save it and another Web Service will read data from MySQL and send it to the Android app.

Using the Code First, we have to create the Web service to read data from the MySQL database. Here is the code for the Android activity to read from the Web Service and parse the JSON object: Here is the PHP code to send data to the Web Service and save it: <? Android activity to send data to the Web Service as a JSON object to save in the MySQL database: Points of Interest To connect to your emulator, you can use this link: To read the JSON object in the Web Service, you can use this line of code: $json = file_get_contents(' $obj = json_decode($json);

Test Credit Card Account Numbers. Algorithm: Get all possible letter combinations from a dialed number. Problem Implement a smart dialer. When typing digits into a dialer, get all contacts that match any letters combination corresponding to the typed digits. If you type 564, for example, the dialer should suggest John.

Solution The core of this dialer is an algorithm that returns all possible letter combinations for a dialed number. After this, just find any contact that starts with any of this combinations. How to do it: We need a mapping between digits and letters.If the dialed number starts with 0 or 1, ignore it as they don't match any letter on the keyboardOtherwise, for each digit in the dialed number, iterate through each array of letters and put each possible combination into a list. Usage: getConditions("564") will return [JMG, JMH, JMI, JNG, JNH, JNI, JOG, JOH, JOI, KMG, KMH, KMI, KNG, KNH, KNI, KOG, KOH, KOI, LMG, LMH, LMI, LNG, LNH, LNI, LOG, LOH, LOI].