Please add below following repositories and dependencies code to your build.gradle( Module:app ) file and You don’t need to download manually the whole library because after adding below code it will automatically download and install the Mp Android Library into your project.
Please add below following repositories and dependencies code to your build.gradle( Module:app ) file and You don’t need to download manually the whole library because after adding below code it will automatically download and install the Mp Android Library into your project.
1)
Please add below following repositories and dependencies code to your build.gradle( Module:app ) file and You don’t need to download manually the whole library because after adding below code it will automatically download and install the Mp Android Library into your project.
3) Main Activity Java
public class MainActivity extends AppCompatActivity {
// Todo : Will show the string "data" that holds the results
TextView results;
// Todo : URL of object to be parsed
String JsonURL = "http://jsonplaceholder.typicode.com/todos/1";
// Todo : Defining the Volley request queue that handles the URL request concurrently
RequestQueue requestQueue;
/*Todo : Set OnClick To Get JSON Data In TextView*/
btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Todo : Creating the JsonObjectRequest class called obreq, passing required parameters:
// Todo : GET is used to fetch data from the server, JsonURL is the URL to be fetched from.
JsonObjectRequest jsObjRequest = new JsonObjectRequest
(Request.Method.GET, JsonURL, null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
/*Todo : Assign Json Value In TextView*/
results.setText("JSON Data Is \n: " + response.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
// TODO Auto-generated method stub
}
});
// Todo : Adds the JSON object request "jsObjRequest" to the request queue
public class ItemData {
String text;
Integer imageId;
public ItemData(String text, Integer imageId){
this.text=text;
this.imageId=imageId;
}
public String getText(){
return text;
}
public Integer getImageId(){
return imageId;
}
}
4) SpinnerAdapter.java
public class SpinnerAdapter extends ArrayAdapter<ItemData> {
int groupid;
Activity context;
ArrayList<ItemData> list;
LayoutInflater inflater;
public SpinnerAdapter(Activity context, int groupid, int id, ArrayList<ItemData>
list){
super(context,id,list);
this.list=list;
inflater=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
this.groupid=groupid;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.msg_category_cards, parent, false);
return new Cards_Adapter.ViewHolder(view);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
Cards Cards = list.get(position);
final int img = Cards.getImg();
final String categiry = Cards.getCategory();
public class MainActivity extends AppCompatActivity {
ImageView image;
PointF DownPT = new PointF(); // Record Mouse Position When Pressed Down
PointF StartPT = new PointF(); // Record Start Position of 'image'
TextView call_logs;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_call__log, container, false);
final int REQUEST_CODE_ASK_PERMISSIONS = 123;
ActivityCompat.requestPermissions(getActivity(), new String[]{"android.permission.READ_CALL_LOG"}, REQUEST_CODE_ASK_PERMISSIONS);
ActivityCompat.requestPermissions(getActivity(), new String[]{"android.permission.WRITE_CALL_LOG"}, REQUEST_CODE_ASK_PERMISSIONS);
}
int number = cur.getColumnIndex( CallLog.Calls.NUMBER );
int type = cur.getColumnIndex(CallLog.Calls.TYPE);
int date = cur.getColumnIndex(CallLog.Calls.DATE);
int duration = cur.getColumnIndex( CallLog.Calls.DURATION);
sb.append( "Call Details : \n");
while ( cur.moveToNext() ) {
String phNumber = cur.getString( number );
String callType = cur.getString(type);
String callDate = cur.getString(date);
Date callDayTime = new Date(Long.valueOf(callDate));
String callDuration = cur.getString( duration );
String dir = null;
int dircode = Integer.parseInt(callType);
switch (dircode) {
case CallLog.Calls.OUTGOING_TYPE:
dir = "OUTGOING";
break;
case CallLog.Calls.INCOMING_TYPE:
dir = "INCOMING";
break;
case CallLog.Calls.MISSED_TYPE:
dir = "MISSED";
break;
}
If You Want To Change Language Then You Want To Make Second Directory Of Value With Language Code And You Need To Diffine Your Hindi Text And Some Classes