Categories Android Studio Tutorial

Show data from mysql database to android fragment

There are two files. 1] java file. 2] fragment file. 1] Java file code package com.example.clinicmgmt; import android.os.AsyncTask; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; public class fetchData extends AsyncTask { public fetchData() { } String data = “”; String dataParsed = […]

Read More
Categories Android Studio Tutorial

Insert data from android app to mysql database

Write this code into fragment file like AddExpensesFragment package com.example.clinicmgmt; import android.os.Bundle; import android.os.StrictMode; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import java.io.BufferedWriter; import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder; /** * A simple {@link Fragment} subclass. […]

Read More