Saturday, 6 February 2016

Simple Phonegap Example

In this tutorial am giving very basic phonegap application source code

Phonegap application very basic web container folder that means it only contains the www folder or container folder
you can generate application using this container will be having html5 , css and java script code

This container should responsive that also you can  achieve easily

that can achieve using different jQuery framework or web development framework

Very familiar framwork are jquerymobile , ionic , sencha about this each framework i wil be discussing in next tutorial

Here sample source code link

https://github.com/QuickBlox/SimpleSample-users-phonegap/blob/master/README.md



Thursday, 4 February 2016

android step (foot) count project Source Code

Hi
 In this project am giving details about android foot count project source code
It counts your steps by using the sensors in the phone.
It calculates the pace (steps per minute), and can help you maintain a desired pace by speaking to you.

Source code
https://github.com/bagilevi/android-pedometer

Wednesday, 3 February 2016

Nokia E1 android Phone Revealed

Nokia E1 Great Design

Most of us know Microsoft took over the Nokia’s Lumia branding and Nokia would not produce smartphones until 2016 to complete the deal. And recently many sources have claimed that Nokia is working on designing new handsets for their comeback, which has been making a lot of people excited. While waiting for this, we found some interesting concepts that can inspire the company, from the high-end category to the low-end one. So, this time, let’s check out one belonging to mid-range: Nokia E1.
Our first impression is that it is very beautiful. Every inch is perfect and outstanding from older handsets of the manufacturer. Specifically, the phone was designed by a Russian designer named Dmitriy Mezenin. If the E1 comes true, it should be made with a metal body though plastic is not too bad. Besides some nice curving, Nokia E1 has extremely thin borders and looks like running Android 5.0 Lollipop OS with Nokia Z Launcher. Maybe Android 6.0 Marshmallow would be better!

Tuesday, 2 February 2016

BlackBerry Android smartphone Priv




BlackBerry has announced its latest Android-powered handset the BlackBerry Priv is available for pre-order and starts shipping 6 November. According to a post on the officialBlackBerry blog, the company said that the device brings ‘the best of BlackBerry security, privacy and productivity to the Android ecosystem.’
The Priv is the first smartphone by BlackBerry that is powered by an operating system other than its own. The device is now listed on the BlackBerry website and is available for pre-order starting at $699 and will ship from 6 November in the US.
The Priv comes with added security to let you know when your data could be at risk, so you can take action to improve it. In terms of specifications, the Priv features a slim design with a slide out physical keyboard, similar to the earlier BlackBerry Torch, but with a more elegant 


Nokia android C1 Leaked Image



it seems finally Nokia has learned a lot from its mistakes, last year company has launched an tablet, the Nokia N1 which runs on most popular OS, and then by the end of year a news floated overinternet that Nokia is working on an Android powered mobile device but at different point of time Nokia kept on rejecting these news and said they are not working on any Android smartphone but now it seems we have a proof for these claims that Nokia is working on an Android powered device.

Saturday, 3 November 2012

Android Tutorial For Remote Mysql data storing in a table Layout

Please Refer http://nisdroid.blogspot.com/2013/07/android-tutorial-for-remote-mysql-data_6.html this blog for complete working Solution

This tutorial describes fetching remote data from MySql database using PHP and storing that in table layout .

This task done with 4 steps
1) Create mysql database
2) PHP script for fetching data from remote database and echo it as JSON Format
3)Create XML table layout
3) Convert JSON encoded data and store it in JSON parsed array .Extract value from JSON parsed array and store it in table


 1)First Create Database and table Example  in mysql
      Example.sql

CREATE TABLE `Example` (
  `COURSE` varchar(10) COLLATE latin1_general_ci NOT NULL,
  `COURSE_NAME` varchar(25) COLLATE latin1_general_ci NOT NULL,
  `CR` varchar(10) COLLATE latin1_general_ci NOT NULL,
  `CT` varchar(10) COLLATE latin1_general_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

2)Create PHP script for fetch data from database and echo it as JSON format  
     example.php
<?php
mysql_connect("localhost","a9280963_root","my123456");
mysql_select_db("a9280963_android");
$response = array();
$sql = mysql_query("SELECT *FROM Example") or die(mysql_error());

// check for empty result
if (mysql_num_rows($sql) > 0) {
    // looping through all results
    // products node
    $response["Assessments1"] = array();

    while ($row = mysql_fetch_array($sql)) {
        // temp user array
        $Assessments12 = array();
        $Assessments12["COURSE"] = $row["COURSE"];
        $Assessments12["COURSE_NAME"] = $row["COURSE_NAME"];
        $Assessments12["CR"] = $row["CR"];
        $Assessments12["CT"] = $row["CT"];
        
        // push single product into final response array
        array_push($response["Assessments1"], $Assessments12);
    }
    // success
    $response["success"] = 1;

    // echoing JSON response
    echo json_encode($response);
} else {
    // no products found
    $response["success"] = 0;
    $response["message"] = "No products found";

    // echo no users JSON
    echo json_encode($response);
}
?>


3)Table layout for data to be store here only layout is specified and the TableRow and columns are in java code 
    tablemain.xml
   <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:background="#3b3b3b">
    
    <HorizontalScrollView
  android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
> 
    <TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
                    android:stretchColumns="0,1"
                    android:id="@+id/main_table" 
                    android:layout_weight="1" 
                    android:layout_height="wrap_content" 
                    android:layout_width="fill_parent"
        >
       
            </TableLayout>
</HorizontalScrollView>
</LinearLayout>


4) Java code for fetch the JSON array and parse JSON array into JSON Object and store it in table layout
example.java
   public class example extends Activity {
    /** Called when the activity is first created. */
private static String url = "http://nissarcs.net78.net/android/example.php";
private static final String TAG_Assessments = "Assessments1";
private static final String TAG_CODE = "COURSE";
private static final String TAG_CNH = "COURSE_NAME";
private static final String TAG_CR = "CR";
private static final String TAG_CT = "CT";
JSONArray degree = null;

 tl.addView(tr_head, new TableLayout.LayoutParams(
                LayoutParams.FILL_PARENT,
                LayoutParams.WRAP_CONTENT));
        Integer count=0;
        ArrayList<HashMap<String, String>> contactList = new ArrayList<HashMap<String, String>>();
        JSONParser jParser = new JSONParser();
        JSONObject json = jParser.getJSONFromUrl(url);
        try {
// Getting Array of Contacts
        degree = json.getJSONArray(TAG_Assessments);
// looping through All Contacts
for(int i = 0; i < degree.length(); i++){
JSONObject c = degree.getJSONObject(i);
// Storing each json item in variable
   
    String code = c.getString(TAG_CODE);
    String name = c.getString(TAG_CNH);
    String cr = c.getString(TAG_CR);
    String ct = c.getString(TAG_CT);
   
TableRow tr = new TableRow(this);
      if(count%2!=0) tr.setBackgroundColor(Color.BLACK);
      tr.setPadding(0, 0, 0, 2);
      tr.setId(100+count);
      tr.setLayoutParams(new LayoutParams(
      LayoutParams.WRAP_CONTENT,
      LayoutParams.WRAP_CONTENT));

      //Create two columns to add as table data
        // Create a TextView to add date
       
      TextView labelCR = new TextView(this);
      labelCR.setId(200+count); 
      labelCR.setText(cr);
      labelCR.setPadding(5, 5, 5, 5);
      labelCR.setTextColor(Color.BLACK);
      labelCR.setBackgroundColor(Color.GRAY);
      tr.addView(labelCR);
       
      TextView labelSC = new TextView(this);
      labelSC.setId(200+count);
      labelSC.setText(code.toString());
      labelSC.setPadding(5, 5, 5, 5);
      labelSC.setTextColor(Color.BLACK);
      labelSC.setBackgroundColor(Color.LTGRAY);
      tr.addView(labelSC);
       
      TextView labelACTIVITY = new TextView(this);
      labelACTIVITY.setId(200+count);
      labelACTIVITY.setText(name.toString());
      labelACTIVITY.setPadding(5, 5, 5, 5);
      labelACTIVITY.setTextColor(Color.BLACK);
      labelACTIVITY.setBackgroundColor(Color.GRAY);
      tr.addView(labelACTIVITY);
       
      TextView labelSAT = new TextView(this);
      labelSAT.setId(200+count);
      labelSAT.setText(cr.toString());
      labelSAT.setPadding(5, 5, 5, 5);
      labelSAT.setTextColor(Color.BLACK);
      labelSAT.setBackgroundColor(Color.LTGRAY);
      tr.addView(labelSAT);
    // finally add this to the table row
      tl.addView(tr, new TableLayout.LayoutParams(
                          LayoutParams.FILL_PARENT,
                          LayoutParams.WRAP_CONTENT));
// creating new HashMap
HashMap<String, String> map = new HashMap<String, String>();
// adding each child node to HashMap key => value
map.put(TAG_CODE, code);
map.put(TAG_CNH, name);
map.put(TAG_CR, cr);
map.put(TAG_CT,ct);
// adding HashList to ArrayList
contactList.add(map);
}
} catch (JSONException e) {
e.printStackTrace();
}
 }
}

Output Will be like this