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.

Monday 10 June 2013

Girls wanna know how can you make Messy Braided Bun??

Girls would like to like make Messy Braided Bun on your hair for any traditional occasion??then follow this steps and get ready for your party and events.


Girls if make this Bun then comment your experience please and upload your pic with this hair style.


"Home truths on career wives" one of the best article of Chetan Bhagat related to Cocktail Movie

Home truths on career wives

below article is written by Chetan Bhagat and published on The Times of India too.


Recently, I saw the recently released movie,Cocktail. The plot revolves around a philanderer hero who has to make the tough choice between two hot women. The uber-modern movie was set in London. The characters drank, danced in nightclubs and had one-night stands with aplomb. They worked in new-age inspirational jobs like glamour photography, graphic art and software design. And yet, the guy eventually chooses the girl who cooks home food, dresses conservatively, wins his mother's approval and is happy to be the ideal Indian wife. In fact, even the rejected girl, a free-spirited, independent woman agrees to change herself. To get the guy, she is happy to cook and change her lifestyle to match that of the ideal Indian wife. 


While the movie was fun, such depictions disturb me a little. When successful, strong women are portrayed as finding salvation in making dal and roti for their husbands, one wonders what kind of India we are presenting to our little girls. 
Really, is that what a woman's life is all about — to make hot phulkas? Of course, i shouldn't be so bothered, many would say. It is a Bollywood movie. The commercial pressure to present a palatable story is real. Above all, the makers have a right to tell the narrative they want. 
Yet, when our most modern and forward cinema sinks into regressive territory, it is unfair to our women. It is also depressing because deep down we know such attitudes exist. Many Indian men, even the educated ones, have two distinct profiles of women — the girlfriend material and the wife material. One you party with, the other you take home. The prejudice against non-traditional women who assert themselves is strong. 
Let us look at another part of the world. Yahoo, a leading tech firm and a Fortune 500 company, recently hired a new woman CEO, Marissa Mayer. What's more, she was six months pregnant when she was hired, a fact she did not hide in her interviews. 
Marissa will take some time off after childbirth and will be back at work later. She can manage both. There is something to celebrate about that. Marissa is a role model for women and even men. 
I'd like Indian men to have an open mind about choosing their life partners and revise their 'ideal woman' criteria. Having a traditional wife who cooks, cleans and is submissive might be nice. However, choosing a capable, independent and career-oriented woman can also bring enormous benefits. For instance, one, a man who marries a career woman gets a partner to discuss his own career with. A working woman may be able to relate better to organizational issues than a housewife. A spouse who understands office politics and can give you good advice can be an asset. Two, a working woman diversifies the family income streams. In the era of expensive apartments and frequent lay-offs, a working spouse can help you afford a decent house and feel more secure about finances. Three, a working woman is better exposed to the world. She brings back knowledge and information that can be useful to the family. Whether it's the latest deals or the best mutual fund to invest in, or even new holiday destinations, a working woman can add to the quality of life. Four, the children of a working woman learn to be more independent and will do better than mollycoddled children. Five, working women often find some fulfillment in their jobs, apart from home. Hence, they may have better life satisfaction, and feel less dependent on the man. This in turn can lead to more harmony. Of course, all these benefits accrue if men are able to keep their massive, fragile egos aside and see women as equals. 
Sure, there are drawbacks also in being with working women. But the modern age that we are in, the phulka-making bride may come at a cost of missing out on other qualities. Please bear that in mind before you judge women based on their clothes, interest in the kitchen or the confidence in their voice. 
My mother worked for 40 years. My wife is the COO at an international bank. It makes me proud. She doesn't make phulkas for me. We outsource that work to our help, and it doesn't really bother me. If my wife had spent her life in the kitchen, it would have bothered me more. 
Please choose your partner carefully. Don't just tolerate, but accept and even celebrate our successful women. They take our homes ahead and our country forward. We may have less hot phulkas, but we will have a better nation.

Sunday 9 June 2013

Girls Would you like to make different and awesome hair style?

Girls so would you like to make awesome and different HAIR style easily??
then see this and try it on your hair and get ready for so many good complement.


see full image kindly click on the image and enjoy girls.

so you like it??
if you did this on your hair and you like it then comment girls.


Saturday 8 June 2013

How can you make a fake virus?

so friends would you like to freak out your friends??

you can make fake virus which is harmless and full of joy so follow this some steps and enjoy..!!
are you ready for it??

This is simple Shutdown virus.


Step 1:

copy the following text without any bullets in notepad or any other text editor and save this file as FILENAME.bat and your batch file is created now.

@echo off
echo Insert a message of impending doom here.
shutdown -s -f -t 60 -c "type a message you want to appear here."

Step 2 :

now close this file and get ready to make a fake icon :D :P on your desktop or anywhere.
now right click on your desktop and then new -> shortcut

Step 3:

now for the location of your shortcut choose your virus which you made right now.

Step 4: 

now click on the next button and and give a shortcut name that your victim/friend will click on it.
click on the finish button. and your shortcut is now ready.

Step 5:

now right click on your shortcut you have just made now and choose "properties".

Step 6:

now click on the "choose icon" button and choose any icon for your virus file and click "ok" button twice.

NOTE: This will not work in Windows 7 Pro


Tuesday 4 June 2013

How to create nameless folder?

Before attempting this trick, try to make a folder with no name and you will fail to do so. This is what this trick will let you do.
  1. Make a New folder on desktop or where ever you want.
  1. Right click on this newly created folder and select Rename.
  1. Erase the text showing “New Folder”.
  1. Now keep Pressing Alt (i.e alter key) and type 255. If you are on laptop then you need to enable your Num Lock and type from the highlighted number keys not from those below function keys.
  1. After that leave alt key and Press enter.
  1. Done you just created nameless folder.

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

  

Superb Speech by Chetan Bhagat at Symbiosis.... .


  Don't just have career or academic goals. Set goals to give you a balanced, successful life. I use the word balanced before successful. Balanced means ensuring your health, relationships, mental peace are all in good order. There is no point of getting a promotion on the day of your breakup. There is no fun in driving a car if your back hurts. Shopping is not enjoyable if your mind is full of tensions."Life is one of those races in nursery school where you have to run with a marble in a spoon kept in your mouth. If the marble falls, there is no point coming first. Same is with life where health and relationships are the marble. Your striving is only worth it if there is harmony in your life. Else, you may achieve the success, but this spark, this feeling of being excited and alive, will start to die?One thing about nurturing the spark - don't take life seriously. Life is not meant to be taken seriously, as we are really temporary here. We are like a prepaid card with limited validity. If we are lucky, we may last another 50 years. And 50 years is just 2,500 weekends. Do we really need to get so worked up? ?It's OK, bunk a few classes, scoring low in couple of papers, goof up a few interviews, take leave from work, fall in love, little fights with your spouse. We are people, not programmed devices...? ."Don't be serious, be sincere."

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