Hi everyone,
    I facing a issue reading back the data i posted on the server... can
anyone tell me what went wrong?
Here is the code snippet ::



private void postData1(){
>
>
>         HttpClient httpclient = new DefaultHttpClient();
>
>         HttpPost httppost = new HttpPost(
>                 "http://www.aneeshpradeep.co.uk/NottTest/post.php";);
>
>         JSONObject json = new JSONObject();
>
>         try {
>
>             // JSON data:
>
>             try {
>                 json.put("name", "Fahmi Rahman");
>             } catch (JSONException e1) {
>                 // TODO Auto-generated catch block
>                 e1.printStackTrace();
>             }
>
>             json.put("position", "sysdev");
>
>             JSONArray postjson = new JSONArray();
>
>             postjson.put(json);
>
>             // Post the data:
>
>             httppost.setHeader("json", json.toString());
>
>             httppost.getParams().setParameter("jsonpost", postjson);
>
>             // Execute HTTP Post Request
>
>             System.out.print(json);
>
>             HttpResponse response = httpclient.execute(httppost);
>             tv.setText("Hiii");
>
>             // for JSON:
>
>             if (response != null)
>
>             {
>                 Log.i("Json","respose");
>                 System.out.print("loooooooooool");
>
>
>                 InputStream is = response.getEntity().getContent();
>
>                 BufferedReader reader = new BufferedReader(
>                         new InputStreamReader(is));
>
>                 StringBuilder sb = new StringBuilder();
>
>                 String line = null;
>
>                 try {
>
>                     while ((line = reader.readLine()) != null) {
>
>                         sb.append(line + "\n");
>
>                     }
>
>                 } catch (IOException e) {
>
>                     e.printStackTrace();
>
>                 } finally {
>
>                     try {
>
>                         is.close();
>
>                     } catch (IOException e) {
>
>                         e.printStackTrace();
>
>                     }
>
>                 }
>
>                 text = sb.toString();
>
>             }
>
>             else{
>                 tv.setText("no respose");
>                 Log.i("Noting","happended");
>             }
>
>             //tv.setText(text);
>
>         } catch (ClientProtocolException e) {
>
>             Log.i("Error","Prtocol");
>
>
>         } catch (IOException e) {
>
>             Log.i("Error","IO");
>
>         } catch (JSONException e) {
>             Log.i("Error","JOSON");
>
>         }
>
>     }
>
>
>
>
>
>
>
> On Tue, Jun 19, 2012 at 7:09 PM, aishwarya shukla <
> aishwaryashukl...@gmail.com> wrote:
>
>>
>>
>> ---------- Forwarded message ----------
>> From: aishwarya shukla <aishwaryashukl...@gmail.com>
>> Date: Mon, Jun 18, 2012 at 10:49 AM
>> Subject: My experience of the first ever company outbound
>> To: Lakshmi Seetharam <lakshmi...@gmail.com>, sneha <sneha...@gmail.com>,
>> Sanjana Suresh <sanjan...@gmail.com>, Kapsa Bagrecha <
>> kapilbagre...@gmail.com>, sneha lakshmish xl <sneha.lakshmis...@gmail.com
>> >
>>
>>
>> Summary:
>>
>> 60 kms of trek in 5 days, climb from 4200ft to 13200 ft and back,  from
>> 44 degree Celsius to ice and back.
>> 5 days of training at the base camp before the actual trek..
>>
>> Stay in jungle,  fetch vegetables and firewood in jungle and make your
>> own food, no civilisation or mobile connectivity for 5 days.
>> No basic amenities and completely living out in the wild in a group of 8
>> unknown people.
>> Lots of risk, glad to be alive and still can't believe it that I made it
>> back without any major injury.
>>
>> Hi all,
>>     As I write this while on the 8 hour road trip from dehradun to
>> Delhi,  the last 15 days are probably a life changing experience.
>>
>> So let me start a narrative on it this Way.. I joined Tata Motors as a
>> Post Graduate Trainee (PGT) a month ago (14 may). The PGT cadre of Tata is
>> a very well treated group of young and best managers and future leaders
>> from top-10 b-schools in the country.
>>
>> We are treated really well and that includes almost a year of stay in a 3
>> star hotel next to gateway of India.
>>
>> Tata believes that we being the future leaders ought to be given a
>> outbound worthy enough to signify the end of our MBA course and our welcome
>> to the company.
>>
>> And so after a 3 week long induction in South Bombay,  we are sent in
>> batches to Uttarakashi in Uttaranchal for the outbound.
>>
>> So let me now start from the first day.. we (11 tata motors ppl) almost
>> miss the flight to Delhi (cause I was late while packing) ... then we goto
>> Dehradun in a cab and the next day we proceed to Rwada village in
>> Uttarkashi which is our base camp (about 100 kms from Gangotri).
>>
>> The base camp is next to a tributary of Ganges (Asi-Ganga from Dodital)
>> which is our source of water for every need.
>>
>> Next up we are issued our rucksack and sleeping bag and told about basic
>> do's and don'ts before we are sleep in our tents.
>>
>> The next morning begins at 5:30 AM with basic PT (a 3 kms walk and few
>> exercises) and then we (48 people from different Tata companies) are
>> divided into groups such that most people in a group don't know each other.
>>
>> Ok now lemme admit one fact ..I was the most scared and probably the
>> slowest and the bottleneck of the group in most tasks. The group was
>> composed of 4 guys (88 or 89 born) from Tata steel, 1 girl from Tata Steel
>> (88 born) , and 1 36 year old from a Tata Growth shop and 2 of us from TATA
>> Motors.
>>
>> The instructor ( a 40 year old with fitness and skill to climb even Mt.
>> Everest... )  said point blank I had no confidence or trust in anyone
>> including my own feet's grip but I had the fitness and stamina to do what
>> was needed. So what I lacked was the mental strength and a brave enough
>> heart.
>>
>> So when there was rock climbing and flying fox and rappelling I was shit
>> scared and literally had to be pushed and had absolutely no guts to walk
>> down without a rope on a steep incline overlooking a deep valley.
>>
>> Even the girl in my group was more brave than I was and it didn't take
>> others long before they started telling that I ought to be atleast as
>> courageous as her.
>>
>> So by third day after we all 8 had started to know each and our strengths
>> weaknesses and capabilities, I was improving a lot taking inspiration from
>> her.
>>
>> By fourth or fifth day of training in river crossing exercise and jungle
>> treasure hunt I was gaining speed and much needed confidence in myself.
>>
>> Now I am feeling too sleepy in this car to Delhi and will continue this
>> sometime later and tell how I actually scaled 13200 ft and trekked 60 kms
>> and turned around myself from the slowest member to one of the fastest in
>> the group and also tell more about her (I am missing her while writing this
>> and it might not be an exageration to say that probably I have a crush on
>> her)
>>
>> Do write back and sorry for making you bored.
>>
>> Regards,
>> Aishwarya
>>
>> PS: Will be posting pics on fb in a day or two.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to