Latest

    • Earn Money Online By Monetizing YouTube Videos

      You can earn money by enable monetization on your youtube videos. Its very simple and easy , so lets get started. Note : You must be from US region or from a region where youtube allow Video monetizaiton. In Asia , Youtube does not allow some countries to monetize their videos. Steps for Evaluation Step 1 : First of all you need to create a Google Account. So I assume that you already have a Google account. Step 2 : You need a video for monetization too. Note : The video you would have for monetization must not contain any violated contents or copyright claims. Otherwise , Youtube would reject your appeal for monetization. Plus you will not draw fake traffic to your monetized video as Youtube constantly crawl your videos. Step 3 : After creating your google account, open  www.youtube.com . Step 4 : Now click on "My Channel" option at the left side of the page. Step 5 : Now you will be confronted by this screen Step 6 : Now click on "Video Manager" option as highlighted in below image Step 7 : Now you will be confronted with below screen. Just click on the "Channel" option on the left side Step 8 : Now a list would open. Select "monetization" option from the list like below Step 9 : Now click on "Enable Monitization" button. In below screenshot , my channel's monitization is already enabled so you have to enable your own. When you click on "Enable Monitization" button , you will be directed to another screen asking for your google account or google adsense account. You must have either of the above accounts. And then give your login credentials and google will review your monitization process. After few days , google will send you message regarding approval or disapproval for your videos monitization. Note  : Remember , you must be from US region or from the region where Google allows monitization. Read Youtube terms and condition for Monitization from here  Youtube Monitization . Step 10 : After your monitization is approved and enabled. Upload the video to youtube and after that enable monitization on each single video you have uploaded. Go Back to "Video Manager" option located on the left side. Select your video and click on "Edit" button like below Step 11 :  Click on the "monitization" button like below Step 12 : Now check "Display ads" option and monitization will be enabled on your video. Now you are able to earn money from the ads displayed on your videos via Google adsense. Note : You can visit Google adsense terms and policies for displaying ads on your videos and regarding earning money via ads.

Powered by Blogger.

Connecting MySQL database with Android via PHP/Java - Tutorial



In this tutorial , I am gonna show you how you can connect your Android Application to “MySQL” Database through “PHP” and “JAVA“. So lets get started…

* The Android Device would be connected to PHP Script when a user runs Android Application.
* A data will be brought out from database by PHP-Script , Encoding to JSON format will be done and would be sent out to device.
* The Encoded JSON will be arrived to Android Application , Android Application will begin to Parse it and the data would be     displayed to users


Steps For Evaluation

____________________________________________


Step 1  : First Create a php file and plce it to xamp or wamp server root folder , I am using xamp so i will place it in htdocs folder.
Step 2 : Now paste the below code in PHP file.

____________________________________________


Code

____________________________________________


<?php
mysql_connect("localhost","username","password");
mysql_select_db("Database-Name");
$sql=mysql_query("select * from Table-Name where EMP_NAME1 like 'KA%'");
while($row1=mysql_fetch_assoc($sql))
$out-put[]=$row1;
print(json_encode($out-put));
mysql_close();
?>

____________________________________________


Step 3 : Now in Android Application
1) To get data use HTTP-POST.
2) And now Response will be converted to string by you.
3) Now the data should be parsed by you and use it as per your intentions.

____________________________________________


Code

____________________________________________


JSONArray j-Array = null;

String result1 = null;

StringBuilder sb1 = null;

InputStream istream = null;

ArrayList<NameValuePair1> nameValuePairs1 = new ArrayList<NameValuePair1>();

try{
HttpClient httpclient1 = new DefaultHttpClient();
HttpPost httppost1 = new HttpPost("http://YOUR_LOCAL_PC_IP_ADDRESS/htdocs/my-File.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs1));
HttpResponse response1 = httpclient.execute(httppost1);
HttpEntity entity1 = response1.getEntity();
is = entity1.getContent();
}catch(Exception exc){
Log.exc("logTag", "Error in your HTTP, connection "+exc.toString());
}
try{
BufferedReader reader1 = new BufferedReader(new InputStreamReader(istream,"iso-8859-1"),7);
sb1 = new StringBuilder();
sb1.append(reader1.readLine() + "\n");

String line="0";
while ((line1 = reader.readLine()) != null) {
sb1.append(line + "\n");
}
is.close();
result1=sb1.toString();

}catch(Exception e){
Log.exc("logTag", "Error in conversion of result "+exc.toString());
}

String name1;
try{
j-Array = new JSONArray(result1);
JSONObject jsonData1=null;
for(int i=0;i<j-Array.length();i++){
jsonData = jArray.getJSONObject(i);
ct_name11=jsonData.getString("NAME1");
}
}
catch(JSONException e12){
Toast.makeText(getBaseContext(), "Data is not found" ,Toast.LENGTH_LONG).show();
} catch (ParseException e12) {
e12.printStackTrace();
}
}

____________________________________________


Step 4 : Insert following permission in AndroidManifest.xml.

____________________________________________


<uses-permission android:name="android.permission.INTERNET"></uses-permission>

____________________________________________



Reference: You can find the same blog at  http://baidartuts.altervista.org/connecting-mysql-database-with-android-via-php-and-java/
  • Blogger Comments
  • Facebook Comments
Item Reviewed: Connecting MySQL database with Android via PHP/Java - Tutorial Description: Rating: 5 Reviewed By: Unknown