LAMPIRAN PROGRAM. public class ListArrayAdapterPost extends ArrayAdapter<ModelDataPost> {
|
|
- Reginald Dalton
- 6 years ago
- Views:
Transcription
1 1 LAMPIRAN PROGRAM JAVA ListArrayAdapterPost.java package com.example.win.api.adapter; import android.content.context; import android.support.annotation.nonnull; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.textview; import com.example.win.api.model.modeldatapost; import com.example.win.api.r; import java.util.arraylist; /** * Created by JhonDev on 07/10/2016. */ public class ListArrayAdapterPost extends ArrayAdapter<ModelDataPost> { private ArrayList<ModelDataPost> list; private LayoutInflater inflater; private int res; private Context c; public ListArrayAdapterPost(Context context, int resource, ArrayList<ModelDataPost> list) { super(context, resource, list); this.c=context; this.list = list; this.inflater = (LayoutInflater) context.getsystemservice(context.layout_inflater_service); this.res = public View getview(int position, View ViewGroup parent) { MyHolder holder = null;
2 2 if (convertview == null) { convertview = inflater.inflate(res, parent, false); holder = new MyHolder(); holder.id = (TextView) convertview.findviewbyid(r.id.listid); holder.nama = (TextView) convertview.findviewbyid(r.id.listnama); holder.jenis = (TextView) convertview.findviewbyid(r.id.listketerangan); else { convertview.settag(holder); holder = (MyHolder) convertview.gettag(); holder.id.settext("id Postt : "+list.get(position).getidpost()); holder.nama.settext(" "+list.get(position).gettitlepost()); return convertview; public int getcount() { return list.size(); public void remove(modeldatapost object) { super.remove(object); public void clear() { super.clear(); public void notifydatasetchanged() { super.notifydatasetchanged(); static class MyHolder { TextView ID; TextView Nama; TextView Jenis;
3 3 ApiServicePost.java package com.example.win.api.api; import com.example.win.api.model.modeldatapost; import java.util.list; import retrofit2.call; import retrofit2.http.get; import retrofit2.http.query; public interface ApiServicePost Call<List<ModelDataPost>> Call<List<ModelDataPost>> getsingledata(@query("id_post") String id); ModelDataPost.java package com.example.win.api.model; import com.google.gson.annotations.expose; import com.google.gson.annotations.serializedname; public class private private private String komenpost;
4 4 private String keteranganphone; public static final String idpost = "ID_POST"; public static final String titlepost = "ID_POST"; public static final String komenpost = "ID_POST"; public static final String phonee = "ID_POST"; public ModelDataPost(String id, String title, String komen, String keteranganphone) { this.idpost = id; this.titlepost = title; this.komenpost = komen; this.keteranganphone=keteranganphone; public ModelDataPost(String id, String title, String komen, String keteranganphone, String gambar) { this.idpost = id; this.titlepost = title; this.komenpost = komen; this.keteranganphone=keteranganphone; /** * * The idflora */ public String getidpost() { return idpost; /** * idpost * The idflora */ public void setidpost(string idpost) { this.idpost = idpost; /** * * The nama */
5 5 public String gettitlepost() { return titlepost; /** * titlepost * The Nama */ public void setnamatitle(string titlepost) { this.titlepost = titlepost; /** * * The jenis */ public String getkomenpos() { return komenpost; /** * komenpos * The Jenis */ public void setkomenpos(string komenpos) { this.komenpost = komenpost; /** * * The jenis */ public String getketeranganphone() { return keteranganphone; /** * keteranganphone * The Jenis */ public void setketeranganphone(string keteranganphone) { this.keteranganphone = keteranganphone;
6 6 Akunku.java package com.example.win.api; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.bundle; import android.text.html; import android.view.view; import android.widget.button; import android.widget.listview; import android.widget.textview; import android.widget.toast; import org.json.jsonarray; import java.util.hashmap; public class Akunku extends Activity { Button logout, post, home; SessionManager session; ListView lv; ProgressDialog pdialog; JSONArray contacts = null; String username, first_name; protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.akunku); //membuat session untuk user session = new SessionManager(getApplicationContext()); Toast.makeText(getApplicationContext(), "User Login Status:" + session.isloggedin(), Toast.LENGTH_LONG).show(); session.checklogin(); HashMap<String, String> user = session.getuserdetails(); username = user.get(sessionmanager.key_username); first_name = user.get(sessionmanager.key_first_name); TextView status = (TextView)findViewById(R.id.status); status.settext(html.fromhtml("welcome, <b>"+first_name+"</b>")); //inisiasi tombol Logout dan memberi fungsi klik
7 7 logout = (Button)findViewById(R.id.btn_logout); logout.setonclicklistener(new View.OnClickListener() { ); public void onclick(view v) { session.logoutuser(); finish(); post = (Button)findViewById(R.id.btn_post); post.setonclicklistener(new View.OnClickListener(){ ); public void onclick(view v) { Intent i = new Intent(Akunku.this, Post.class); startactivity(i); home = (Button)findViewById(R.id.btn_home); home.setonclicklistener(new View.OnClickListener(){ ); public void onclick(view v) { Intent i = new Intent(Akunku.this, Postt.class); startactivity(i); public void onbackpressed(){ Intent i = new Intent(getApplicationContext(), Login.class); i.setflags(intent.flag_activity_clear_top); startactivity(i); finish(); AlertDialogManager.java package com.example.win.api; import android.app.alertdialog; import android.content.context; import android.content.dialoginterface;
8 8 public class AlertDialogManager public void showalertdialog(context context, String title, String message, Boolean status) { AlertDialog alertdialog = new AlertDialog.Builder(context).create(); //setting DoalogTitle alertdialog.settitle(title); //setting Dialog Message alertdialog.setmessage(message); //setting OK Button alertdialog.setbutton("ok",new DialogInterface.OnClickListener() { public void onclick(dialoginterface dialog, int which) { ); //showing alert message alertdialog.show(); JSONParser.java package com.example.win.api; import android.util.log; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httpget; import org.apache.http.client.methods.httppost; import org.apache.http.client.utils.urlencodedutils; import org.apache.http.impl.client.defaulthttpclient; import org.json.jsonexception; import org.json.jsonobject; import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream;
9 9 import java.io.inputstreamreader; import java.io.unsupportedencodingexception; import java.util.list; public class JSONParser { static InputStream is = null; static JSONObject jobj = null; static String json = ""; // constructor public JSONParser() { public JSONObject getjsonfromurl(string url) { // Making HTTP request try { // defaulthttpclient DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); HttpResponse httpresponse = httpclient.execute(httppost); HttpEntity httpentity = httpresponse.getentity(); is = httpentity.getcontent(); catch (UnsupportedEncodingException e) { e.printstacktrace(); catch (ClientProtocolException e) { e.printstacktrace(); catch (IOException e) { e.printstacktrace(); try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso "), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readline())!= null) { sb.append(line + "\n"); is.close(); json = sb.tostring(); catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.tostring()); // try parse the string to a JSON object
10 10 try { jobj = new JSONObject(json); catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.tostring()); // return JSON String return jobj; public JSONObject makehttprequest(string url, String method, List<NameValuePair> params) { // Making HTTP request try { // check for request method if (method == "POST") { // request method is POST // defaulthttpclient DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); httppost.setentity(new UrlEncodedFormEntity(params)); HttpResponse httpresponse = httpclient.execute(httppost); HttpEntity httpentity = httpresponse.getentity(); is = httpentity.getcontent(); else if (method == "GET") { // request method is GET DefaultHttpClient httpclient = new DefaultHttpClient(); String paramstring = URLEncodedUtils.format(params, "utf-8"); url += "?" + paramstring; HttpGet httpget = new HttpGet(url); HttpResponse httpresponse = httpclient.execute(httpget); HttpEntity httpentity = httpresponse.getentity(); is = httpentity.getcontent(); catch (UnsupportedEncodingException e) { e.printstacktrace(); catch (ClientProtocolException e) { e.printstacktrace();
11 11 catch (IOException e) { e.printstacktrace(); try { BufferedReader reader = new BufferedReader(new InputStreamReader( is, "iso "), 8); StringBuilder sb = new StringBuilder(); String line = null; while ((line = reader.readline())!= null) { sb.append(line + "\n"); is.close(); json = sb.tostring(); catch (Exception e) { Log.e("Buffer Error", "Error converting result " + e.tostring()); // try parse the string to a JSON object try { jobj = new JSONObject(json); catch (JSONException e) { Log.e("JSON Parser", "Error parsing data " + e.tostring()); // return JSON String return jobj; Login.java package com.example.win.api; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast;
12 12 import org.json.jsonarray; import org.json.jsonobject; import java.util.arraylist; import java.util.hashmap; public class Login extends Activity { Button login; Intent a; EditText username, password; TextView verify; String url, success; SessionManager session; AlertDialogManager alert = new AlertDialogManager(); protected void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate) ; setcontentview(r.layout.login); session = new SessionManager(getApplicationContext()); Toast.makeText(getApplicationContext(),"user Login Status:" + session.isloggedin(), Toast.LENGTH_LONG).show(); login username password verify = (Button)findViewById(R.id.btn_login); = (EditText)findViewById(R.id.fld_username); = (EditText)findViewById(R.id.fld_pwd); = (TextView)findViewById(R.id.verify); login.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { url=" + "username=" + username.gettext().tostring() + "&password=" + password.gettext().tostring(); if(username.gettext().tostring().trim().length()>0 && password.gettext().tostring().trim().length()>0){ new AmbilData().execute(); else{
13 13 alert.showalertdialog(login.this,"login Failed...!", "Please insert your username and password",false); ); verify.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { ); a = new Intent(Login.this, Register.class); startactivity(a); public class AmbilData extends AsyncTask<String,String,String> { ArrayList<HashMap<String, String>> contactlist = new ArrayList< HashMap<String, String>>(); ProgressDialog pdialog; protected void onpreexecute() { super.onpreexecute(); pdialog = new ProgressDialog(Login.this); pdialog.setmessage("loading Data..."); pdialog.setindeterminate(false); pdialog.show(); protected String doinbackground(string... arg0) { JSONParser jparser = new JSONParser(); JSONObject json = jparser.getjsonfromurl(url); try { success = json.getstring("success"); Log.e("error", "nilai sukses=" + success); JSONArray hasil = json.getjsonarray("login"); if (success.equals("1")) {
14 14 for (int i = 0; i < hasil.length(); i++) { JSONObject c = hasil.getjsonobject(i); //Storing each json item in variable String username = c.getstring("username").trim(); String = c.getstring(" ").trim(); session.createloginsession(username, ); Log.e("ok", "ambil data"); else { Log.e("Error", "tidak bisa ambil data 0"); catch (Exception e) { Log.e("Error", "Tidak bisa ambil data 1"); return null; protected void onpostexecute(string result) { super.onpostexecute(result); pdialog.dismiss(); if(success.equals("1")){ else{ a = new Intent(Login.this, Akunku.class); startactivity(a); finish(); Toast.makeText(getBaseContext(), "Username/password incorrect!!", Toast.LENGTH_SHORT).show(); alert.showalertdialog(login.this, "Login Failed..", "Username/Password is incorrect",false);
15 15 MainPost.java package com.example.win.api; import android.os.bundle; import android.support.v7.app.appcompatactivity; public class MainPost extends AppCompatActivity { public static final String ROOT_URL = " // protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_post); Post.java package com.example.win.api; import android.app.activity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.toast; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import org.json.jsonobject; import java.util.arraylist; import java.util.list; public class Post extends Activity { ProgressDialog pdialog; JSONParser jsonparser = new JSONParser(); EditText title, komen, phone; Intent a; private static String url = "
16 16 Button submit; protected void oncreate(bundle savedinstancestate) { // TODO Auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.post); submit = (Button)findViewById(R.id.btn_submit); title = (EditText)findViewById(R.id.fld_title); komen = (EditText)findViewById(R.id.fld_komen); phone = (EditText)findViewById(R.id.fld_phone); submit.setonclicklistener(new View.OnClickListener() { public void onclick(view arg0) { // TODO Auto-generated method stub new InputData().execute(); ); public class InputData extends AsyncTask<String, String, String> { String success; protected void onpreexecute() { super.onpreexecute(); pdialog = new ProgressDialog(Post.this); pdialog.setmessage("process..."); pdialog.setindeterminate(false); pdialog.show(); protected String doinbackground(string... args) { String strtitle =title.gettext().tostring(); String strkomen =komen.gettext().tostring(); String strphone =phone.gettext().tostring(); List<NameValuePair> params = new ArrayList<NameValuePair>();
17 17 params.add(new BasicNameValuePair("title",strtitle)); params.add(new BasicNameValuePair("komen",strkomen)); params.add(new BasicNameValuePair("phone",strphone)); JSONObject json = jsonparser.makehttprequest(url, "POST", params); try { success = json.getstring("success"); catch (Exception e) { runonuithread(new Runnable() { public void run() { Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_SHORT).show(); ); return null; protected void onpostexecute(string file_url) { // dismiss the dialog once done pdialog.dismiss(); if (success.equals("1")) { Toast.makeText(getApplicationContext(),"Succesed", Toast.LENGTH_LONG).show(); else{ Toast.makeText(getApplicationContext(),"Failed", Toast.LENGTH_LONG).show(); public void onbackpressed(){ Intent i = new Intent(getApplicationContext(),Akunku.class); i.setflags(intent.flag_activity_clear_top); startactivity(i); finish();
18 18 Postt.java package com.example.win.api; import android.content.intent; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view; import android.widget.adapterview; import android.widget.imageview; import android.widget.linearlayout; import android.widget.listview; import android.widget.textview; import com.example.win.api.api.apiservicepost; import com.example.win.api.adapter.listarrayadapterpost; import com.example.win.api.model.modeldatapost; import java.util.arraylist; import java.util.list; import retrofit2.call; import retrofit2.callback; import retrofit2.response; import retrofit2.retrofit; import retrofit2.converter.gson.gsonconverterfactory; public class Postt extends AppCompatActivity implements AdapterView.OnItemClickListener { ArrayList<ModelDataPost> datapost = new ArrayList<ModelDataPost>(); ListView listview; ListArrayAdapterPost adapter; LinearLayout layout_loading; TextView text_load; ImageView icon_load; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.postt); layout_loading = (LinearLayout) findviewbyid(r.id.layout_loading); text_load = (TextView) findviewbyid(r.id.text_load); icon_load = (ImageView) findviewbyid(r.id.icon_load); listview = (ListView) findviewbyid(r.id.listmhsmhs);
19 19 listview.setonitemclicklistener(postt.this); listview.setdividerheight(0); setup(); public void setup() { Retrofit retrofit = new Retrofit.Builder().baseUrl(MainPost.ROOT_URL).addConverterFactory(GsonConverterFactory.create()).build(); ApiServicePost service = retrofit.create(apiservicepost.class); Call<List<ModelDataPost>> call = service.getsemuamhs(); call.enqueue(new Callback<List<ModelDataPost>>() { public void onresponse(call<list<modeldatapost>> call, Response<List<ModelDataPost>> response) { if (response.issuccessful()) { int jumlah = response.body().size(); for (int i = 0; i < jumlah; i++) { response.body().get(i).getketeranganphone()); ModelDataPost data = new ModelDataPost( response.body().get(i).getidpost(), response.body().get(i).gettitlepost(), response.body().get(i).getkomenpos(), datapost.add(data); Log.d("RESPON", "onresponse: " + response.body().get(i).getidpost()); listview.setvisibility(view.visible); adapter = new ListArrayAdapterPost(Postt.this, R.layout.row_post, datapost); listview.setadapter(adapter); if (adapter.getcount() < 1 ) { layout_loading.setvisibility(view.visible); String error = "Daftar Postt Kosong"; text_load.settext(error); Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_data_kosong); icon_load.setimagebitmap(icon); else { layout_loading.setvisibility(view.gone);
20 20 else { String error = "Error Retrive Data from Server!!!"; text_load.settext(error); Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_network); icon_load.setimagebitmap(icon); public void onfailure(call<list<modeldatapost>> call, Throwable t) { String error = "Error Retrive Data from Server wwaau!!!\n" + t.getmessage(); text_load.settext(error); Bitmap icon = BitmapFactory.decodeResource(getResources(), R.drawable.ic_network); icon_load.setimagebitmap(icon); ); public void onitemclick(adapterview<?> parent, View view, int position, long id) { Intent intent = new Intent(Postt.this, TampilPost.class); intent.putextra(modeldatapost.idpost,datapost.get(position).getidpost()); startactivity(intent); protected void onactivityresult(int requestcode, int resultcode, Intent data) { super.onactivityresult(requestcode, resultcode, data); if (requestcode == 1) { adapter.clear(); setup(); Register.java package com.example.win.api; import android.app.activity;
21 21 import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.view.view; import android.widget.button; import android.widget.edittext; import android.widget.textview; import android.widget.toast; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import org.json.jsonobject; import java.util.arraylist; import java.util.list; public class Register extends Activity { ProgressDialog pdialog; JSONParser jsonparser = new JSONParser(); EditText first_name,last_name, ,username,password; Intent a; private static String url = " Button register; TextView verify; protected void oncreate(bundle savedinstancestate) { // TODO Auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.register); register = (Button)findViewById(R.id.btn_register); verify = (TextView)findViewById(R.id.verify); first_name = (EditText)findViewById(R.id.fld_first); last_name = (EditText)findViewById(R.id.fld_last); = (EditText)findViewById(R.id.fld_ ); username = (EditText)findViewById(R.id.fld_username); password = (EditText)findViewById(R.id.fld_pwd); register.setonclicklistener(new View.OnClickListener() { public void onclick(view arg0) { // TODO Auto-generated method stub
22 22 new InputData().execute(); ); verify.setonclicklistener(new View.OnClickListener() { public void onclick(view v) { a = new Intent(Register.this, Login.class); startactivity(a); ); public class InputData extends AsyncTask<String, String, String> { String success; protected void onpreexecute() { super.onpreexecute(); pdialog = new ProgressDialog(Register.this); pdialog.setmessage("registering Account..."); pdialog.setindeterminate(false); pdialog.show(); protected String doinbackground(string... args) { String strfirst_name=first_name.gettext().tostring(); String strlast_name=last_name.gettext().tostring(); String str = .gettext().tostring(); String strusername=username.gettext().tostring(); String strpassword=password.gettext().tostring(); List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("first_name",strfirst_name)); params.add(new BasicNameValuePair("last_name",strlast_name)); params.add(new BasicNameValuePair(" ",str )); params.add(new BasicNameValuePair("username",strusername)); params.add(new BasicNameValuePair("password",strpassword)); JSONObject json = jsonparser.makehttprequest(url, "POST", params); try { success = json.getstring("success"); catch (Exception e) { runonuithread(new Runnable() {
23 23 public void run() { Toast.makeText(getApplicationContext(), "Error", Toast.LENGTH_SHORT).show(); ); return null; protected void onpostexecute(string file_url) { // dismiss the dialog once done pdialog.dismiss(); if (success.equals("1")) { Toast.makeText(getApplicationContext(),"Registration Succesed", Toast.LENGTH_LONG).show(); else{ Toast.makeText(getApplicationContext(),"Registration Failed", Toast.LENGTH_LONG).show(); public void onbackpressed(){ Intent i = new Intent(getApplicationContext(),Login.class); i.setflags(intent.flag_activity_clear_top); startactivity(i); finish(); SessionManager.java package com.example.win.api; import android.annotation.suppresslint; import android.content.context; import android.content.intent; import android.content.sharedpreferences; import android.content.sharedpreferences.editor; import java.util.hashmap;
24 public class SessionManager { //Shared Preferences SharedPreferences pref; //Editor for Shared preferences Editor editor; //context Context _context; //shared pref mode int PRIVATE_MODE = 0; //nama sharepreference private static final String PREF_NAME = "Sesi"; // All Shared Preferences Keys private static final String IS_LOGIN = "IsLoggedIn"; public static final String KEY_USERNAME = "username"; public static final String KEY_FIRST_NAME = "first_name"; //constructor public SessionManager(Context context){ this._context = context; pref = _context.getsharedpreferences(pref_name, PRIVATE_MODE); editor = pref.edit(); //Create Login Session public void createloginsession(string username, String first_name){ //Storing Login value as TRUE editor.putboolean(is_login, true); editor.putstring(key_username, username); editor.putstring(key_first_name, first_name); editor.commit(); /** * Check Login method wil check user Login status * If false it will redirect user to Login page * Else won't do anything * */ public void checklogin(){ // Check Login status
25 25 if(!this.isloggedin()) { Intent i = new Intent(_context, Login.class); i.addflags(intent.flag_activity_clear_top); i.setflags(intent.flag_activity_new_task); _context.startactivity(i); /** * Get stored session data * */ public HashMap<String, String> getuserdetails(){ HashMap<String,String> user = new HashMap<String,String>(); user.put(key_username, pref.getstring(key_username, null)); user.put(key_first_name, pref.getstring(key_first_name, null)); return user; /** * Clear session details * */ public void logoutuser(){ // Clearing all data from Shared Preferences editor.clear(); editor.commit(); Intent i = new Intent(_context, Login.class); i.addflags(intent.flag_activity_clear_top); i.setflags(intent.flag_activity_new_task); _context.startactivity(i); public boolean isloggedin(){ return pref.getboolean(is_login, false);
26 26 SplashScreen.java package com.example.win.api; import android.app.activity; import android.content.intent; import android.os.bundle; import android.os.handler; import android.view.window; import android.view.windowmanager; public class SplashScreen extends Activity { //Set waktu lama splashscreen private static int splashinterval = 3000; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, WindowManager.LayoutParams.FLAG_FULLSCREEN); setcontentview(r.layout.splashscreen); new Handler().postDelayed(new Runnable() { public void run() { // TODO Auto-generated method stub Intent i = new Intent(SplashScreen.this, Login.class); startactivity(i); //jeda selesai Splashscreen this.finish(); private void finish() { // TODO Auto-generated method stub, splashinterval); ;
27 27 TampilPost.java package com.example.win.api; import android.net.uri; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.widget.imageview; import android.widget.textview; import com.example.win.api.api.apiservicepost; import com.example.win.api.model.modeldatapost; import com.google.android.gms.appindexing.action; import com.google.android.gms.appindexing.appindex; import com.google.android.gms.common.api.googleapiclient; import java.util.list; import retrofit2.call; import retrofit2.callback; import retrofit2.response; import retrofit2.retrofit; import retrofit2.converter.gson.gsonconverterfactory; public class TampilPost extends AppCompatActivity { String ID_POST; TextView et_id, et_nama, et_keterangan, et_phone; ImageView et_gambar; /** * ATTENTION: This was auto-generated to implement the App Indexing API. * See for more information. */ private GoogleApiClient client; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_detail_post); ID_POST = getintent().getstringextra(modeldatapost.idpost); et_id = (TextView) findviewbyid(r.id.tampil_id); et_nama = (TextView) findviewbyid(r.id.tampil_nama); et_keterangan = (TextView) findviewbyid(r.id.tampil_keterangan); et_phone = (TextView) findviewbyid(r.id.tampil_phone); et_gambar = (ImageView) findviewbyid(r.id.tampil_gambar); binddata(); API. // ATTENTION: This was auto-generated to implement the App Indexing
28 28 // See for more information. client = new GoogleApiClient.Builder(this).addApi(AppIndex.API).build(); public void binddata() { Retrofit retrofit = new Retrofit.Builder().baseUrl(MainPost.ROOT_URL).addConverterFactory(GsonConverterFactory.create()).build(); ApiServicePost service = retrofit.create(apiservicepost.class); Call<List<ModelDataPost>> call = service.getsingledata(id_post); call.enqueue(new Callback<List<ModelDataPost>>() { public void onresponse(call<list<modeldatapost>> call, final Response<List<ModelDataPost>> response) { if (response.issuccessful()) { try { int jumlah = response.body().size(); for (int i = 0; i < jumlah; i++) { final int finali = i; runonuithread(new Runnable() { public void run() { et_id.settext(response.body().get(finali).getidpost()); et_nama.settext(response.body().get(finali).gettitlepost()); et_keterangan.settext(response.body().get(finali).getkomenpos()); et_phone.settext(response.body().get(finali).getketeranganphone()); ); catch (Exception e) { e.printstacktrace();
29 29 t) { public void onfailure(call<list<modeldatapost>> call, Throwable ); public void onstart() { super.onstart(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See for more information. client.connect(); Action viewaction = Action.newAction( Action.TYPE_VIEW, // TODO: choose an action type. "TampilPost Page", // TODO: Define a title for the content shown. // TODO: If you have web page content that matches this app activity's content, // make sure this auto-generated web page URL is correct. // Otherwise, set the URL to null. Uri.parse(" // TODO: Make sure this auto-generated app URL is correct. Uri.parse("androidapp://com.example.win.api/http/host/path") ); AppIndex.AppIndexApi.start(client, viewaction); public void onstop() { super.onstop(); // ATTENTION: This was auto-generated to implement the App Indexing API. // See for more information. Action viewaction = Action.newAction( Action.TYPE_VIEW, // TODO: choose an action type. "TampilPost Page", // TODO: Define a title for the content shown. // TODO: If you have web page content that matches this app activity's content, // make sure this auto-generated web page URL is correct. // Otherwise, set the URL to null. Uri.parse(" // TODO: Make sure this auto-generated app URL is correct. Uri.parse("androidapp://com.example.win.api/http/host/path")
30 30 ); AppIndex.AppIndexApi.end(client, viewaction); client.disconnect(); XML activity_detail_post.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="10dp" android:background="#ffffff" > <ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:visibility="gone" android:gravity="center" android:layout_width="match_parent" android:text="description" android:fontfamily="times" android:textsize="25dp" android:layout_gravity="center" android:textcolor="#000"
31 31 android:textstyle="bold"/> <ImageView android:visibility="gone" android:paddingleft="5dp" android:paddingright="5dp" android:background="#f4f3f3" android:layout_width="match_parent" android:layout_height="250dp" /> <TextView android:layout_width="match_parent" android:textcolor="#0e0e0e" android:paddingleft="5dp" android:paddingtop="10dp" android:paddingbottom="10dp" android:gravity="center" android:text="nama" android:fontfamily="times" android:textsize="15dp" android:layout_gravity="left" /> <TextView android:paddingleft="5dp" android:paddingtop="10dp" android:paddingbottom="10dp" android:textcolor="#000000" android:layout_width="match_parent" android:text="keterangan" android:fontfamily="times" android:textsize="15dp" android:layout_gravity="left" android:layout_alignparentleft="true" android:layout_alignparentstart="true" /> <TextView
32 32 android:paddingleft="5dp" android:paddingbottom="10dp" android:paddingtop="10dp" android:textcolor="#000000" android:layout_width="match_parent" android:text="phone" android:layout_margin="0dp" android:fontfamily="times" android:textsize="15dp" android:layout_gravity="left" /> <TextView android:visibility="gone" android:background="#10100f" android:textcolor="#fff" android:layout_marginbottom="20dp" android:layout_margintop="350dp" android:text="id" android:layout_margin="0dp" android:fontfamily="casual" android:textsize="25dp" android:layout_gravity="left" /> </RelativeLayout> </ScrollView> </LinearLayout> activity_post.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent"
33 33 tools:context="com.example.win.api.mainpost"> <TextView android:text="hello World!" /> </RelativeLayout> akunku.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android=" android:fillviewport="false"> <RelativeLayout xmlns:tools=" tools:context=".mainactivity"> <ImageView android:layout_width="fill_parent" android:layout_height="150dp" android:layout_alignparentstart="true" /> <TextView android:layout_width="match_parent" android:padding="10dp" android:textsize="15sp" /> <LinearLayout
34 34 android:layout_centerhorizontal="true" android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> </LinearLayout> <Button android:layout_width="290dp" android:gravity="center" android:text="list" android:textsize="13sp" android:textstyle="bold" android:layout_margintop="175dp" android:layout_centerhorizontal="true" /> <Button android:layout_width="290dp" android:gravity="center" android:text="post" android:textsize="13sp" android:textstyle="bold" android:layout_margintop="5dp" android:layout_centerhorizontal="true" /> <Button android:layout_width="290dp" android:gravity="center" android:textsize="13sp" android:textstyle="bold" android:layout_margintop="5dp" android:layout_centerhorizontal="true" /> </RelativeLayout> </ScrollView>
35 35 loading_and_result.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_centerinparent="true" android:orientation="vertical" <ImageView android:layout_width="100dp" android:layout_height="100dp" android:layout_gravity="center" /> <TextView android:text="download Data From Server\nPlease wait..." android:textcolor="#000" android:textsize="15sp" android:textstyle="bold" android:gravity="center"/> </LinearLayout> </RelativeLayout> login.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android=" android:fillviewport="false"> <RelativeLayout xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent"
36 36 tools:context=".mainactivity"> <TextView android:text="login" android:layout_width="match_parent" android:gravity="center" android:padding="10dp" android:textsize="20sp" <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView android:text="username" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:hint="enter Your User Name" android:layout_marginleft="45dp" android:inputtype="text address" android:paddingleft="5dp" android:textsize="13sp" android:layout_gravity="center_vertical"/> </LinearLayout> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal">
37 37 <TextView android:text="password" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:hint="enter Password" android:layout_marginleft="40dp" android:inputtype="textpassword" android:paddingleft="5dp" android:textsize="13sp" android:layout_gravity="center_vertical"/> </LinearLayout> <Button android:layout_width="290dp" android:layout_centerhorizontal="true" android:gravity="center" android:layout_margintop="15dp" android:textsize="13sp" android:textstyle="bold" android:text="login"/> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal" android:layout_centerhorizontal="true"> <TextView android:text="not have an account?! Register Here" android:textsize="12sp" android:layout_gravity="center_vertical"
38 38 </LinearLayout> </RelativeLayout> </ScrollView> post.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android=" android:fillviewport="false"> <RelativeLayout xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity"> <TextView android:text="post a Job" android:layout_width="match_parent" android:gravity="center" android:padding="10dp" android:textsize="20sp" android:textcolor="@android:color/white" android:background="@android:color/holo_blue_dark"/> <LinearLayout android:id="@+id/ _block" android:layout_below="@+id/header" android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> </LinearLayout> <LinearLayout android:id="@+id/komentar_block" android:layout_below="@+id/title_block"
39 39 android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView android:text="description" android:textsize="16sp" android:layout_gravity="center_vertical"/> </LinearLayout> <Button android:layout_width="290dp" android:layout_centerhorizontal="true" android:gravity="center" android:layout_margintop="15dp" android:textsize="13sp" android:textstyle="bold" android:text="submit"/> <EditText android:layout_width="100dp" android:layout_height="100dp" android:layout_gravity="center_vertical" android:layout_margintop="10dp" android:hint="describe the Job" android:inputtype="textmultiline" android:paddingleft="5dp" android:textsize="13sp" /> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal" android:weightsum="1"> <TextView
40 40 android:text="phone" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:hint="enter Your Phone Number" android:layout_marginleft="30dp" android:inputtype="number" android:paddingleft="7dp" android:textsize="13sp" android:layout_gravity="center_vertical" android:layout_weight="1.85" /> </LinearLayout> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal" android:weightsum="1"> <TextView android:text="title" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:layout_gravity="center_vertical" android:layout_marginleft="40dp" android:layout_weight="2.09" android:hint="insert Title" android:inputtype="textmultiline" android:paddingleft="7dp" android:textsize="13sp" />
41 41 </LinearLayout> </RelativeLayout> </ScrollView> postt.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".postt"> <ListView android:layout_width="match_parent" android:layout_height="match_parent" android:padding="6dp" android:cliptopadding="false" android:scrollbars="none" android:visibility="gone"/> <include </RelativeLayout> register.xml <?xml version="1.0" encoding="utf-8"?> <ScrollView android:layout_height="match_parent" android:layout_width="match_parent" xmlns:android=" android:fillviewport="false"> <RelativeLayout xmlns:tools=" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity">
42 42 <TextView android:layout_width="match_parent" android:gravity="center" android:padding="10dp" android:textsize="20sp" <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView android:text="first Name" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:layout_gravity="center_vertical" android:layout_marginleft="40dp" android:hint="enter Your First Name" android:inputtype="text address" android:paddingleft="5dp" android:textsize="13sp" /> </LinearLayout> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView
43 43 android:text="last Name" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:layout_gravity="center_vertical" android:layout_marginleft="40dp" android:hint="enter Your Last Name" android:inputtype="text address" android:paddingleft="5dp" android:textsize="13sp" /> </LinearLayout> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView android:text=" " android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:hint="enter Address" android:layout_marginleft="75dp" android:inputtype="text address" android:paddingleft="5dp" android:textsize="13sp" android:layout_gravity="center_vertical"/> </LinearLayout> <LinearLayout
44 44 android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView android:text="username" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:hint="enter Your Username" android:layout_marginleft="40dp" android:inputtype="text address" android:paddingleft="7dp" android:textsize="13sp" android:layout_gravity="center_vertical"/> </LinearLayout> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal"> <TextView android:text="password" android:textsize="16sp" android:layout_gravity="center_vertical"/> <EditText android:hint="enter Password"
45 45 </LinearLayout> android:layout_marginleft="40dp" android:inputtype="textpassword" android:paddingleft="5dp" android:textsize="13sp" android:layout_gravity="center_vertical"/> <Button android:layout_width="290dp" android:layout_centerhorizontal="true" android:gravity="center" android:layout_margintop="15dp" android:textsize="13sp" android:textstyle="bold" android:text="register"/> <LinearLayout android:layout_marginleft="2dp" android:layout_margintop="25dp" android:orientation="horizontal" android:layout_centerhorizontal="true"> <TextView android:text="already have an account?! Login here" android:textsize="12sp" android:layout_gravity="center_vertical" </LinearLayout> </RelativeLayout> </ScrollView> row_post.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android=" xmlns:app=" android:layout_width="match_parent"
46 46 android:background="#91f5ea" android:orientation="horizontal"> <android.support.v7.widget.cardview android:layout_margintop="5dp" android:layout_width="match_parent" app:cardelevation="5dp" app:cardcornerradius="7dp" android:layout_margin="2dp"> <LinearLayout android:layout_width="match_parent" android:layout_margin="7dp" android:orientation="vertical" > <TextView android:layout_width="300dp" android:fontfamily="times" android:text="nama Barang" android:textcolor="#000" android:textsize="15sp" android:padding="20dp" android:textstyle="bold" /> <TextView android:layout_width="match_parent" android:visibility="gone" /> <TextView android:visibility="gone" android:layout_margintop="5dp" android:text="keterangan" android:textcolor="#fff" android:textsize="15dp" /> <TextView
47 47 android:visibility="gone" android:layout_margintop="5dp" android:text="keterangan" android:textcolor="#fff" android:textsize="15dp" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:orientation="vertical" > <ImageView android:visibility="gone" android:padding="5dp" android:layout_marginright="5dp" android:background="#fff" android:layout_width="80dp" android:layout_height="80dp" android:layout_gravity="right"/> </LinearLayout> </android.support.v7.widget.cardview> </LinearLayout> splashscreen.xml <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android=" android:layout_width="match_parent" android:layout_height="match_parent" <ImageView android:layout_width="300dp" android:layout_height="300dp" android:layout_centervertical="true" android:foregroundgravity="center_vertical" android:layout_centerhorizontal="true" /> <ProgressBar
LAMPIRAN PROGRAM. public class Listdata_adiktif extends ArrayAdapter<ModelData_adiktif> {
1 LAMPIRAN PROGRAM JAVA Listdata_adiktif.java package com.example.win.api.adapter; import android.content.context; import android.support.annotation.nonnull; import android.view.layoutinflater; import
More information<uses-permission android:name="android.permission.internet" />
Listing Program : 1. Android Manifest.xml
More informationCoding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis;
Coding Menggunakan software Eclipse: Mainactivity.java (coding untuk tampilan login): package com.bella.pengontrol_otomatis; import android.app.activity; import android.os.bundle; import android.os.countdowntimer;
More informationSerious Gaming. Technical manual. This document is a collection of the code and installation process
Serious Gaming Technical manual This document is a collection of the code and installation process Peter Elliott 02/04/2017 Contents Table of figures... 3 Introduction... 4 Installation instructions...
More informationM.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126
M.A.D ASSIGNMENT # 2 REHAN ASGHAR BSSE 15126 Submitted to: Sir Waqas Asghar MAY 23, 2017 SUBMITTED BY: REHAN ASGHAR Intent in Android What are Intent? An Intent is a messaging object you can use to request
More informationandroid:layout_margintop="5dp" > <EditText android:layout_width="210dp"
activity_main.xml
More informationM.A.D Assignment # 1
Submitted by: Rehan Asghar Roll no: BSSE (7) 15126 M.A.D Assignment # 1 Submitted to: Sir Waqas Asghar Submitted by: M. Rehan Asghar 4/25/17 Roll no: BSSE 7 15126 XML Code: Calculator Android App
More informationTip Calculator. xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
Tip Calculator activity_main.xml
More informationUser Interface Development in Android Applications
ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture User Interface Development in Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan
More informationMAD ASSIGNMENT NO 3. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.
MAD ASSIGNMENT NO 3 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. MainActivity.java File package com.example.tutorialspoint; import android.manifest;
More informationAndroid JSON Parsing Tutorial
Android JSON Parsing Tutorial by Kapil - Thursday, May 19, 2016 http://www.androidtutorialpoint.com/networking/json-parsing-tutorial-android/ YouTube Video JSON(JavaScript Object Notation), is a language
More informationPractical 1.ListView example
Practical 1.ListView example In this example, we show you how to display a list of fruit name via ListView. Android Layout file File : res/layout/list_fruit.xml
More informationTabel mysql. Kode di PHP. Config.php. Service.php
Tabel mysql Kode di PHP Config.php Service.php Layout Kode di Main Activity package com.example.mini.webandroid; import android.app.progressdialog; import android.os.asynctask; import android.support.v7.app.appcompatactivity;
More informationAndroid - JSON Parser Tutorial
Android - JSON Parser Tutorial JSON stands for JavaScript Object Notation.It is an independent data exchange format and is the best alternative for XML. This chapter explains how to parse the JSON file
More informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Switching UIs
EMBEDDED SYSTEMS PROGRAMMING 2015-16 Application Tip: Switching UIs THE PROBLEM How to switch from one UI to another Each UI is associated with a distinct class that controls it Solution shown: two UIs,
More informationITU- FAO- DOA- TRCSL. Training on. Innovation & Application Development for E- Agriculture. Shared Preferences
ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Shared Preferences 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran Tanveer, ITU Experts
More informationPENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE)
PENGEMBANGAN APLIKASI PERANGKAT BERGERAK (MOBILE) Network Connection Web Service K Candra Brata andra.course@gmail.com Mobille App Lab 2015-2016 Network Connection http://developer.android.com/training/basics/network-ops/connecting.html
More informationIntents. Your first app assignment
Intents Your first app assignment We will make this. Decidedly lackluster. Java Code Java Code XML XML Preview XML Java Code Java Code XML Buttons that work
More information@Bind(R.id.input_ ) EditText EditText Button _loginbutton;
package cyborg.pantaucctv; import android.app.progressdialog; import android.content.intent; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view;
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Managing Screen Orientation
EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Managing Screen Orientation ORIENTATIONS Portrait Landscape Reverse portrait Reverse landscape ON REVERSE PORTRAIT Android: all four orientations are
More informationAndroid Apps Development for Mobile and Tablet Device (Level I) Lesson 2
Workshop 1. Compare different layout by using Change Layout button (Page 1 5) Relative Layout Linear Layout (Horizontal) Linear Layout (Vertical) Frame Layout 2. Revision on basic programming skill - control
More informationFragment Example Create the following files and test the application on emulator or device.
Fragment Example Create the following files and test the application on emulator or device. File: AndroidManifest.xml
More informationBasic GUI elements - exercises
Basic GUI elements - exercises https://developer.android.com/studio/index.html LIVE DEMO Please create a simple application, which will be used to calculate the area of basic geometric figures. To add
More informationAndroid CardView Tutorial
Android CardView Tutorial by Kapil - Wednesday, April 13, 2016 http://www.androidtutorialpoint.com/material-design/android-cardview-tutorial/ YouTube Video We have already discussed about RecyclerView
More informationANDROID PROGRAMS DAY 3
ANDROID PROGRAMS DAY 3 //Android project to navigate from first page to second page using Intent Step 1: Create a new project Step 2: Enter necessary details while creating project. Step 3: Drag and drop
More informationEMBEDDED SYSTEMS PROGRAMMING Application Tip: Saving State
EMBEDDED SYSTEMS PROGRAMMING 2016-17 Application Tip: Saving State THE PROBLEM How to save the state (of a UI, for instance) so that it survives even when the application is closed/killed The state should
More informationAndroid Workshop: Model View Controller ( MVC):
Android Workshop: Android Details: Android is framework that provides java programmers the ability to control different aspects of smart devices. This interaction happens through the Android SDK (Software
More informationTextView Control. EditText Control. TextView Attributes. android:id - This is the ID which uniquely identifies the control.
A TextView displays text to the user. TextView Attributes TextView Control android:id - This is the ID which uniquely identifies the control. android:capitalize - If set, specifies that this TextView has
More informationCreate a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks.
CIS 470 Lesson 13 Databases - Quick Notes Create a local SQL database hosting a CUSTOMER table. Each customer includes [id, name, phone]. Do the work inside Threads and Asynctasks. package csu.matos; import
More informationLAMPIRAN 1 LAMPIRAN 2 SCREENSHOOT LAMPIRAN 3 LISTING FILE JAVA CLASS 1. main_activity.java packagecom.example.sig.sigrs; import android.content.intent; import android.net.uri; import android.support.v7.app.appcompatactivity;
More information// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer
// MainActivity.java ; Noah Spenser; Senior Design; Diabetic Breathalyzer package com.noahspenser.seniordesign; import android.os.parcel; import android.os.parcelable; import android.support.v7.app.appcompatactivity;
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationCreate Parent Activity and pass its information to Child Activity using Intents.
Create Parent Activity and pass its information to Child Activity using Intents. /* MainActivity.java */ package com.example.first; import android.os.bundle; import android.app.activity; import android.view.menu;
More informationData Persistence. Chapter 10
Chapter 10 Data Persistence When applications create or capture data from user inputs, those data will only be available during the lifetime of the application. You only have access to that data as long
More informationCSE 660 Lab 7. Submitted by: Arumugam Thendramil Pavai. 1)Simple Remote Calculator. Server is created using ServerSocket class of java. Server.
CSE 660 Lab 7 Submitted by: Arumugam Thendramil Pavai 1)Simple Remote Calculator Server is created using ServerSocket class of java Server.java import java.io.ioexception; import java.net.serversocket;
More informationDynamically Create Admob Banner and Interstitial Ads
Dynamically Create Admob Banner and Interstitial Ads activity_main.xml file 0 0 0
More informationStoppUhr. <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="start1"
StoppUhr
More informationAPPENDIX. Application Store Admin. build.gradle. app/build.gradle
Application Store Admin build.gradle APPENDIX // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() dependencies { classpath
More informationMobile Application Development Lab [] Simple Android Application for Native Calculator. To develop a Simple Android Application for Native Calculator.
Simple Android Application for Native Calculator Aim: To develop a Simple Android Application for Native Calculator. Procedure: Creating a New project: Open Android Stdio and then click on File -> New
More informationMAD ASSIGNMENT NO 2. Submitted by: Rehan Asghar BSSE AUGUST 25, SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept.
MAD ASSIGNMENT NO 2 Submitted by: Rehan Asghar BSSE 7 15126 AUGUST 25, 2017 SUBMITTED TO: SIR WAQAS ASGHAR Superior CS&IT Dept. Android Widgets There are given a lot of android widgets with simplified
More informationAndroid Specifics. Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9)
Android Specifics Jonathan Diehl (Informatik 10) Hendrik Thüs (Informatik 9) Android Specifics ArrayAdapter Preferences Widgets Jonathan Diehl, Hendrik Thüs 2 ArrayAdapter Jonathan Diehl, Hendrik Thüs
More informationAPPENDIX. Application User. MainActivity.java. RegistrationActivity.java
Application User APPENDIX MainActivity.java package com.example.finalproject; import android.content.intent; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view;
More informationStatistics http://www.statista.com/topics/840/smartphones/ http://www.statista.com/topics/876/android/ http://www.statista.com/statistics/271774/share-of-android-platforms-on-mobile-devices-with-android-os/
More informationApplied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB)
Applied Cognitive Computing Fall 2016 Android Application + IBM Bluemix (Cloudant NoSQL DB) In this exercise, we will create a simple Android application that uses IBM Bluemix Cloudant NoSQL DB. The application
More informationLISTING PROGRAM APLIKASI ANDROID
1 LISTING PROGRAM APLIKASI ANDROID AboutFragment.java package tia.restodj; import android.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup;
More informationAndroid Layout Types
Android Layout Types Android Linear Layout Android LinearLayout is a view group that aligns all children in either vertically or horizontally. android:divider - This is drawable to use as a vertical divider
More informationSMART VEHICLE TRACKING APPLICATION
SMART VEHICLE TRACKING APPLICATION Report submitted for the partial fulfillment of the requirements for the degree of Bachelor of Technology in Information Technology Submitted by Ritaman Baral (IT2014/008)
More informationCITIZEN COP PRESENTED BY :- A CLOUD BASED CRIME REPORT APPLICATION. SOUVIK ROY - IT2014/066 AWSAF AMBAR - IT2014/067 SAYANI DUTTA - IT2014/089
CITIZEN COP CITIZEN COP A CLOUD BASED CRIME REPORT APPLICATION. PRESENTED BY :- SOUVIK ROY - IT2014/066 AWSAF AMBAR - IT2014/067 SAYANI DUTTA - IT2014/089 1 CITIZEN COP A CLOUD BASED CRIME REPORTING APP
More informationProduced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar
Mobile Application Development Higher Diploma in Science in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology
More informationSMAATSDK. NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0
SMAATSDK NFC MODULE ON ANDROID REQUIREMENTS AND DOCUMENTATION RELEASE v1.0 NFC Module on Android Requirements and Documentation Table of contents Scope...3 Purpose...3 General operating diagram...3 Functions
More informationEMBEDDED SYSTEMS PROGRAMMING UI Specification: Approaches
EMBEDDED SYSTEMS PROGRAMMING 2016-17 UI Specification: Approaches UIS: APPROACHES Programmatic approach: UI elements are created inside the application code Declarative approach: UI elements are listed
More information<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android=" package="com.example.root.
1 Android Manifest.Xml />
More information<uses-permission android:name="android.permission.internet"/>
Chapter 11 Playing Video 11.1 Introduction We have discussed how to play audio in Chapter 9 using the class MediaPlayer. This class can also play video clips. In fact, the Android multimedia framework
More informationTUTOR FINDER APP REPORT OF MAJOR PROJECT SUBMITTED FOR PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE DEGREE OF MASTERS OF COMPUTER APPLICATION
TUTOR FINDER APP REPORT OF MAJOR PROJECT SUBMITTED FOR PARTIAL FULFILLMENT OF THE REQUIREMENT FOR THE DEGREE OF MASTERS OF COMPUTER APPLICATION BISHAL MANDAL REGISTRATION NO: 151170510014 of 2015-2016
More informationMyDatabaseHelper. public static final String TABLE_NAME = "tbl_bio";
Page 1 of 5 MyDatabaseHelper import android.content.context; import android.database.sqlite.sqliteopenhelper; class MyDatabaseHelper extends SQLiteOpenHelper { private static final String DB_NAME = "friend_db";
More informationGraphical User Interfaces
Graphical User Interfaces Some suggestions Avoid displaying too many things Well-known anti-patterns Display useful content on your start screen Use action bars to provide consistent navigation Keep your
More informationArrays of Buttons. Inside Android
Arrays of Buttons Inside Android The Complete Code Listing. Be careful about cutting and pasting.
More informationStarting Another Activity Preferences
Starting Another Activity Preferences Android Application Development Training Xorsat Pvt. Ltd www.xorsat.net fb.com/xorsat.education Outline Starting Another Activity Respond to the Button Create the
More informationCreating a Custom ListView
Creating a Custom ListView References https://developer.android.com/guide/topics/ui/declaring-layout.html#adapterviews Overview The ListView in the previous tutorial creates a TextView object for each
More informationAndroid SQLite Database Tutorial - CRUD Operations
Android SQLite Database Tutorial - CRUD Operations by Kapil - Monday, March 21, 2016 http://www.androidtutorialpoint.com/storage/android-sqlite-database-tutorial/ YouTube Video Android SQLite Introduction
More informationCSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015
CSE 660 Lab 3 Khoi Pham Thanh Ho April 19 th, 2015 Comment and Evaluation: This lab introduces us about Android SDK and how to write a program for Android platform. The calculator is pretty easy, everything
More informationAppendix A : Android Studio Code For Android
Appendix A : Android Studio Code For Android Monitoring : ` public Pubnub pubnub; public static final String PUBLISH_KEY = "pub-c-798bd0f6-540b-48af-9e98-7d0028a5132a"; public static final String SUBSCRIBE_KEY
More informationA Crash Course to Android Mobile Platform
Enterprise Application Development using J2EE Shmulik London Lecture #2 A Crash Course to Android Mobile Platform Enterprise Application Development Using J2EE / Shmulik London 2004 Interdisciplinary Center
More informationAdapter.
1 Adapter An Adapter object acts as a bridge between an AdapterView and the underlying data for that view The Adapter provides access to the data items The Adapter is also responsible for making a View
More informationProgramming with Android: Introduction. Layouts. Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna
Programming with Android: Introduction Layouts Luca Bedogni Marco Di Felice Dipartimento di Informatica: Scienza e Ingegneria Università di Bologna Views: outline Main difference between a Drawable and
More informationMVC Apps Basic Widget Lifecycle Logging Debugging Dialogs
Overview MVC Apps Basic Widget Lifecycle Logging Debugging Dialogs Lecture: MVC Model View Controller What is an App? Android Activity Lifecycle Android Debugging Fixing Rotations & Landscape Layouts Localization
More informationAdaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University.
Creating dialogs Adaptation of materials: dr Tomasz Xięski. Based on presentations made available by Victor Matos, Cleveland State University. Portions of this page are reproduced from work created and
More informationActionBar. import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { }
Android ActionBar import android.support.v7.app.actionbaractivity; public class MyAppBarActivity extends ActionBarActivity { Layout, activity.xml
More informationAndroid Application development for importing Vehicles to Ethiopia Tracking system. Zekir Ahmed Awol
Android Application development for importing Vehicles to Ethiopia Tracking system Zekir Ahmed Awol Thesis Business Information Technology 2016 Abstract 30/11/2016 Degree programme Author Zekir Ahmed Awol
More informationMobile Development Lecture 9: Android & RESTFUL Services
Mobile Development Lecture 9: Android & RESTFUL Services Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Elgayyar.weebly.com What is a RESTFUL Web Service REST stands for REpresentational State Transfer. In
More informationDatabase Development In Android Applications
ITU- FAO- DOA- TRCSL Training on Innovation & Application Development for E- Agriculture Database Development In Android Applications 11 th - 15 th December 2017 Peradeniya, Sri Lanka Shahryar Khan & Imran
More informationChapter 8 Positioning with Layouts
Introduction to Android Application Development, Android Essentials, Fifth Edition Chapter 8 Positioning with Layouts Chapter 8 Overview Create user interfaces in Android by defining resource files or
More informationAPI Guide for Gesture Recognition Engine. Version 2.0
API Guide for Gesture Recognition Engine Version 2.0 Table of Contents Gesture Recognition API... 3 API URI... 3 Communication Protocol... 3 Getting Started... 4 Protobuf... 4 WebSocket Library... 4 Project
More informationAPPENDIX CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE
APPENDIX FILE MainActivity.java CODE TO STORE THE BUTTON MENU AND MOVE THE PAGE package com.ste.sembakoapp; import Android.content.Intent; import Android.support.v7.app.AppCompatActivity; import Android.os.Bundle;
More informationAndroid UI Development
Android UI Development Android UI Studio Widget Layout Android UI 1 Building Applications A typical application will include: Activities - MainActivity as your entry point - Possibly other activities (corresponding
More informationThread. A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables.
1 Thread A Thread is a concurrent unit of execution. The thread has its own call stack for methods being invoked, their arguments and local variables. Each virtual machine instance has at least one main
More informationDiving into Android. By Jeroen Tietema. Jeroen Tietema,
Diving into Android By Jeroen Tietema Jeroen Tietema, 2015 1 Requirements 4 Android SDK 1 4 Android Studio (or your IDE / editor of choice) 4 Emulator (Genymotion) or a real device. 1 See https://developer.android.com
More informationPress project on the left toolbar if it doesn t show an overview of the app yet.
#3 Setting up the permissions needed to allow the app to use GPS. Okay! Press project on the left toolbar if it doesn t show an overview of the app yet. In this project plane, we will navigate to the manifests
More informationSizing and Positioning
CS 193A Layout This document is copyright (C) Marty Stepp and Stanford Computer Science. Licensed under Creative Commons Attribution 2.5 License. All rights reserved. Sizing and Positioning How does the
More informationLecture 14. Android Application Development
Lecture 14 Android Application Development Notification Instructor Muhammad Owais muhammad.owais@riphah.edu.pk Cell: 03215500223 Notifications Used to notify user for events Three general forms of Notifications
More information... 1... 2... 2... 3... 3... 4... 4... 5... 5... 6... 6... 7... 8... 9... 10... 13... 14... 17 1 2 3 4 file.txt.exe file.txt file.jpg.exe file.mp3.exe 5 6 0x00 0xFF try { in.skip(9058); catch (IOException
More informationAndroid Programs Day 5
Android Programs Day 5 //Android Program to demonstrate the working of Options Menu. 1. Create a New Project. 2. Write the necessary codes in the MainActivity.java to create OptionMenu. 3. Add the oncreateoptionsmenu()
More informationManifest.xml. Activity.java
Dr.K.Somasundaram Ph.D Professor Department of Computer Science and Applications Gandhigram Rural Institute, Gandhigram, Tamil Nadu-624302, India ka.somasundaram@gmail.com Manifest.xml
More informationCOMP61242: Task /04/18
COMP61242: Task 2 1 16/04/18 1. Introduction University of Manchester School of Computer Science COMP61242: Mobile Communications Semester 2: 2017-18 Laboratory Task 2 Messaging with Android Smartphones
More informationA-1. Listing Program. CariKata.java. package com.indah.kmp;
A-1 Listing Program CariKata.java package com.indah.kmp; import java.io.bufferedreader; import java.io.file; import java.io.filenotfoundexception; import java.io.filereader; import java.io.ioexception;
More informationAdvanced Android Development
Advanced Android Development review of greporter open-source project: GPS, Audio / Photo Capture, SQLite, HTTP File Upload and more! Nathan Freitas, Oliver+Coady nathan@olivercoady.com Android Platform
More information1. Simple List. 1.1 Simple List using simple_list_item_1
1. Simple List 1.1 Simple List using simple_list_item_1 1. Create the Android application with the following attributes. Application Name: MySimpleList Project Name: Package Name: MySimpleList com.example.mysimplelist
More informationUser Interface Development. CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr.
User Interface Development CSE 5236: Mobile Application Development Instructor: Adam C. Champion Course Coordinator: Dr. Rajiv Ramnath 1 Outline UI Support in Android Fragments 2 UI Support in the Android
More informationelse if(rb2.ischecked()) {
Problem :Toy Calculator Description:Please design an Android application that contains 2 activities: cal_main and cal_result. The following figure is a suggested layout for the cal_main activity. For the
More informationPROGRAMMING APPLICATIONS DECLARATIVE GUIS
PROGRAMMING APPLICATIONS DECLARATIVE GUIS DIVING RIGHT IN Eclipse? Plugin deprecated :-( Making a new project This keeps things simple or clone or clone or clone or clone or clone or clone Try it
More information05. RecyclerView and Styles
05. RecyclerView and Styles 08.03.2018 1 Agenda Intents Creating Lists with RecyclerView Creating Cards with CardView Application Bar Menu Styles and Themes 2 Intents 3 What is Intent? An Intent is an
More informationAndroid Apps Development for Mobile and Tablet Device (Level I) Lesson 4. Workshop
Workshop 1. Create an Option Menu, and convert it into Action Bar (Page 1 8) Create an simple Option Menu Convert Option Menu into Action Bar Create Event Listener for Menu and Action Bar Add System Icon
More informationANDROID USER INTERFACE
1 ANDROID USER INTERFACE Views FUNDAMENTAL UI DESIGN Visual interface element (controls or widgets) ViewGroup Contains multiple widgets. Layouts inherit the ViewGroup class Activities Screen being displayed
More informationLAB MANUAL SITTTR KALAMASSERY SMART DEVICE PROGRAMMING LAB. SITTTR Smart Device Programming Manual Page 1
LAB MANUAL SMART DEVICE PROGRAMMING LAB 6138 by SITTTR KALAMASSERY SITTTR Smart Device Programming Manual Page 1 STATE INSTITUTE OF TECHNICAL TEACHERS TRAINING AND RESEARCH GENERAL INSTRUCTIONS Rough record
More informationProduced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar
Design Patterns MSc in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie
More informationQ.1 Explain the dialog and also explain the Demonstrate working dialog in android.
Q.1 Explain the dialog and also explain the Demonstrate working dialog in android. - A dialog is a small window that prompts the user to make a decision or enter additional information. - A dialog does
More informationLAMPIRAN. Lampiran 1 Source Code service a. Source Code koneksi. b. source code service user
LAMPIRAN Lampiran 1 Source Code service a. Source Code koneksi. package goodjob.rest.service; java.sql.connection; java.sql.drivermanager; java.sql.resultset; java.sql.sqlexception; java.sql.statement;
More informationTopics of Discussion
Reference CPET 565 Mobile Computing Systems CPET/ITC 499 Mobile Computing Fragments, ActionBar and Menus Part 3 of 5 Android Programming Concepts, by Trish Cornez and Richard Cornez, pubslihed by Jones
More information