Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.os.StrictMode;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class MainActivity extends AppCompatActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//StrictMode kullanarak,ağ erişiminin güvenli bir şekilde yapılmasını sağlıyoruz...
StrictMode.ThreadPolicy policy = new
StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
String wcfUrl= "http://androiduygulama.tk/test.php";
String jsonString="";
JSONObject obj=new JSONObject();
try {
HttpClientMy HttpClientMy=new HttpClientMy();
//RESTful Web servisini çağırıp, içerikleri sunucuya gönderen ve sunucudan data çekmeyi sağlayn methodu çağırdık,
jsonString=HttpClientMy.callWebService(wcfUrl, obj);
//jsonString değişkenen gelen değer:
// {"Android":{“student_email”:”[email protected]”,”student_phoneNumber”:”5355850987″,”name_surname”:”Tugba Üstündag”}}
//Json string ini parse edicek methodu yazdık..
ParseResponseJSONData(jsonString);
} catch (Exception e) {
e.printStackTrace();
}
}
//RESTful Web servis'den gelen json string i parse eden method
public void ParseResponseJSONData(String jsonString) {
JSONObject jsonResponse;
try {
//Json objesi olusturuyoruz..
jsonResponse = new JSONObject(jsonString);
//Olusturdugumuz obje üzerinden json string deki dataları kullanıyoruz..
String sob = jsonResponse.getString("author");
JSONArray sys = jsonResponse.getJSONArray("categories");
String title=sys.getJSONObject(0).getString("title");
String state =sys.getJSONObject(0).getString("isActive");
//Sunucudan gelen dataları kullanıcıyı göstermek için, TextView controller'ına değerilerimizi gönderiyoruz
TextView author = (TextView) findViewById(R.id.author);
TextView baslik = (TextView) findViewById(R.id.baslik);
TextView isActive= (TextView) findViewById(R.id.isActive);
author.setText(sob);
baslik.setText(title);
isActive.setText(state);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team