Showing posts with label CSE. Show all posts
Showing posts with label CSE. Show all posts

Sunday, 8 December 2013

How to store and access data from SQL Database using Android without using sqlite

Here one example is given in which i am storing the data into SQL database from Android and also can Display the Data in  Android App from SQL

We are using JSON here because  It is very useful and it makes easy our work which is actually very difficult without JSON.

JSON (JavaScript Object Notation) is a lightweight data exchange format inspired by JavaScript object
literals. It is often used with JavaScript, Ajax, and RESTful web services but is completely language independent.

temp.php

<?php
mysql_connect("localhost","root","");
mysql_select_db("tempdb");
$name=$_REQUEST["firstname"];
$lname=$_REQUEST["lastname"];
$query="insert into tbl_student values(NULL,'".$name."','".$lname."')";
mysql_query($query);
?>

select.php

<?php
mysql_connect("localhost","root","");
mysql_select_db("tempdb");
$query="select * from tbl_student";
$resultset=mysql_query($query);
while($row=mysql_fetch_assoc($resultset))
{
$output[]=$row;
}
print(json_encode($output));
?>

MainActivity.java

public class MainActivity extends Activity {

String result = null;
InputStream is = null;
StringBuilder sb = null;

int ct_id;
String[] ct_name = null;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);

// http post
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://10.0.2.2/mittal/select.php");
// httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
} catch (Exception e) {
Log.e("log_tag", "Error in http connection" + e.toString());
}

// convert response to string
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
sb = new StringBuilder();
sb.append(reader.readLine() + "\n");
String line = "0";
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
result = sb.toString();
} catch (Exception e) {
Log.e("log_tag", "Error converting result " + e.toString());
}

// paring data
JSONArray jArray;
try {
jArray = new JSONArray(result);
JSONObject json_data = null;
ct_name = new String[jArray.length()];
for (int i = 0; i < jArray.length(); i++) {
json_data = jArray.getJSONObject(i);
ct_id = json_data.getInt("student_id");
ct_name[i] = json_data.getString("student_name")+" "+json_data.getString("student_sname");
}
} catch (JSONException e1) {
Toast.makeText(getBaseContext(), "No City Found", Toast.LENGTH_LONG)
.show();
} catch (ParseException e1) {
e1.printStackTrace();
}

ListView lv=(ListView)findViewById(R.id.listView1);
ArrayAdapter<String> lvadptr=new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1,ct_name);
lv.setAdapter(lvadptr);

// insert code start
Button btn=(Button)findViewById(R.id.button1);
btn.setOnClickListener(new View.OnClickListener() {

@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
EditText et1=(EditText)findViewById(R.id.editText1);
EditText et2=(EditText)findViewById(R.id.editText2);
String fname=et1.getText().toString();
String lname=et2.getText().toString();

ArrayList<NameValuePair> namevaluepairs=new ArrayList<NameValuePair>();
namevaluepairs.add(new BasicNameValuePair("firstname", fname));
namevaluepairs.add(new BasicNameValuePair("lastname", lname));

try
{
HttpClient httpclient=new DefaultHttpClient();
HttpPost httppost=new HttpPost("http://10.0.2.2/mittal/temp.php");
httppost.setEntity(new UrlEncodedFormEntity(namevaluepairs));

HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();

Intent newint=new Intent(getApplicationContext(), MainActivity.class);
startActivity(newint);

}
catch(Exception e)
{
Log.d("myerror", e.toString());
}
}
});
//insert code end
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}

Friday, 22 November 2013

Data Flow Diagrams for Online Shopping Website

(Click on Diagram to see full view of Diagram)
Level 0
(Click on Diagram to see full view of Diagram)



Level 1
(Click on Diagram to see full view of Diagram)


Level 2 for 2.0
(Click on Diagram to see full view of Diagram)



Level 2 for 4.0
(Click on Diagram to see full view of Diagram)



Level 2 for 5.0
(Click on Diagram to see full view of Diagram)



Level 3 for 4.3
(Click on Diagram to see full view of Diagram)

Thursday, 12 September 2013

Activity Diagram for Admin in Online Shopping website





Thursday, 13 June 2013

Fences app that organize your desktop.

friends now its time to organize to tidy and clustered desktop and it is categorized your desktop and sort as you want.

Fences is a brand new toolbar for sorting and un-cluster your desktop.The fences look the same - they're clean and blend well, and you can adjust the transparency and color to suit your needs. You'll also still be able to easily sort your files and program icons into multiple fences on your desktop. One of our favorite features, Auto-Organizer, also lets you choose which files will automatically go into the fence you specify--this is handy if you frequently add new files to your computer. 

you can download fences toolbar from below link.

click here for download

enjoy sorting your desktop.

Now converting video format is child's play..!!

if you want to convert a video in one format to another format than now it is child's play friends.you should first download a Handbrake video converter.This video converter accepts practically all the format of the video as a source and it also includes chapter selection, basic subtitle support and audio embedding. With tree diagrams and tabs in the interface, Handbrake is a pleasure to use. 

you can download Handbrake form below link.

click here for download Handbrake



friends use this and enjoy converting.
share with us your experience.

Tuesday, 4 June 2013

How can you recover your all data which are permanently deleted??

Accidentally deleted a file?

Never fear; the data is probably still on your drive and may be recoverable by one software. 
This software is called Lickass Undelete.


Kickass Undelete finds all of the deleted files on your hard drive, flash drive or SD card and allows you to recover them.

Click Here to Download this Software.


Screenshots :

Features:

  • Free and Open Source
  • Support for both FAT and NTFS filesystems
  • Filter by file name and extension
  • Easy-to-use interface
  • Unreasonably large scan button

Disclaimer :  Undeletion works best if performed as soon as possible after file deletion. When you delete a file, the data is not lost - but new files being written to the hard drive may overwrite your data permanently, making recovery impossible.

Monday, 3 June 2013

How can you prevent your folder without any software installation

Without any software installation you can prevent your folder and data that no one can access your folder and even can not delete your folder

Try this in your laptop or PC having windows OS and enjoy this by applying in your folder 

Follow this steps :


1)open Start --> type "cmd"
one black window is opened called command prompt

2)now set your path in command prompt...
In command prompt there is default path is set this default path is of your current user

3)now type in command prompt "cd.." till your path is like "c:\>"

4)then write a name of your local Drive
eg. G: or D: or E: 
and press enter now you are in this particular drive which you will give in your command prompt

5) type this code in your command prompt and a folder's access is denied so no one access this folder now

"cacls folder_name /e /p everyone:n"

so now your folder has no access and no one even delete this folder

now if you want to access your folder then again follow all above four (4) steps and only 5th step is different only

the code is for access your folder is

"cacls folder_name /e /p everyone:f"


for any query just comment in this post.

Sunday, 2 June 2013

How can you use your all Anroids Apps in your laptop and PC

Now You can use all Android Apps in your PC and laptop by using bluestacks Application in your laptop/PC and you can enjoy Android without Smartphones.

first you should download this application in your computer and you can download this from

Now install this application in your laptop/PC
now there is one icon at desktop..

 now open this and you can see one screen and in this screen you can see one bar like this....


this bar may be somewhat different because it depends on the newly version of the bluestacks and now you search your desired Apps and download all that Apps and Enjoy Android without Smartphones

  

Sunday, 19 May 2013

UML Diagrams for ATM Machine

Class Diagram for ATM Machine




Use case diagram for ATM Machine

State Diagram for ATM system

State Diagrams for ATM Transaction

Sequence Diagram for ATM Session

Sequence Diagram for PIN verification
 

UML Diagrams for Hospital Management

To see Image properly click on the image



Class Diagram for hospital mgmt



Class Diagram for Hospital mgmt UML



Reception's  state chart diagram for hospital mgmt



Doctor's State Diagram for Hospital mgmt




patient state chart diagram for hospital mgmt



Activity Diagram for Hospital Mgmt Test




Activity Diagram for Hospital Mgmt Treatment and Operation





Activity Diagram for Hospital Mgmt Ward Allocation




Activity Diagram  for Hospital Mgmt Ward Allocation



Activity Diagram for patient payment hospital mgmt



Activity Diagram for doctor appointment hospital mgmt



use case diagram for hospital mgmt



Use Case Diagram for Hospital Mgmt UML




sequence diagram bed allotments hospital mgmt


sequence diagram test appointments hospital mgmt




Sequence Diagram for Hospital Mgmt Test and Operation



Sequence Diagram for Hospital Mgmt Discharge




Collaboration Diagram for Hospital Mgmt Discharge




Collaboration Diagram for Hospital Mgmt Register and Bed Allocation



Collaboration Diagram for Hospital Mgmt Treatment and Operation



Collaboration Diagram for bed allotment hospital mgmt




Collaboration Diagram for test appointments hospital mgmt


Component Diagram for hospital mgmt




Deployment Diagram for hospital mgmt