[android-developers] Animating concentric circle created in drawable xml

2016-11-24 Thread sameer khan


*Main Acitivity class:*

public class MainActivity extends AppCompatActivity {

 ImageView img;
 //GradientDrawable shape;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 // TODO Auto-generated method stub
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);
 img=(ImageView) findViewById(R.id.callingAnim);



 }
 public void onStart(){
 Animation myFadeInAnimation = AnimationUtils.loadAnimation(MainActivity.this, 
R.anim.animation);
 Animation myFadeOutAnimation = AnimationUtils.loadAnimation(MainActivity.this, 
R.anim.animation1);

 int value = 0;
 for (int i=0;i<10;i++){
 if (value == 0){
 img.startAnimation(myFadeInAnimation);
 value = 1;
 }
 else if (value == 1){
 img.startAnimation(myFadeOutAnimation);
 value = 0;
 }
 }



 super.onStart();
 }
}

res/drawable/concentric.xml

http://schemas.android.com/apk/res/android;>
 

 
 

 
 
 
 

 
 
 

 
 
 
 
 
 
 

 
 
 
 

 
 
 

 
 
 
 
 
 
 

 
 
 
 
 
 
 

 
 
 
 

 
 
 

 
 
 
 

 
 
 

 
 
 
 

 
 
 

 
 
 
 

 
 
 

 
 
 

 


FadeIn animation(res/anim/animation.xml)


http://schemas.android.com/apk/res/android;>
 


Fade Out animation(animation1.xml)


http://schemas.android.com/apk/res/android;>
 


This fade in and fade out complete drawable where else i want each circle to 
fade in then fade out all continously in a loop to infinite. Please help!


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/d5ea84a3-3622-4f0f-b453-41c3dc55529d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Api Calling problem

2016-10-17 Thread sameer khan


Find below detail for API : 

*URL :* http://192.168.0.19/monika/slim_prj/public/code

*Request Parameter *(in POST)

- mac_address

- key

*Response* (in JSON) - 

{
"status": 1,
"message": "qYNoQBImXRhOMety"
}


my code goes here--> 

package com.medmainfomatix.myapplication1;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ProgressBar;
import android.widget.TextView;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;


public class MainActivity extends AppCompatActivity {

 EditText emailText;
 EditText emailText1;
 TextView responseView;
 ProgressBar progressBar;

 static final String API_URL = 
"http://192.168.0.19/monika/slim_prj/public/code/;;

 @Override
 protected void onCreate(Bundle savedInstanceState) {
 super.onCreate(savedInstanceState);
 setContentView(R.layout.activity_main);

 responseView = (TextView) findViewById(R.id.responseView);
 emailText = (EditText) findViewById(R.id.emailText);
 emailText1= (EditText) findViewById(R.id.emailText1);

 progressBar = (ProgressBar) findViewById(R.id.progressBar);

 Button queryButton = (Button) findViewById(R.id.queryButton);
 queryButton.setOnClickListener(new View.OnClickListener() {
 @Override
 public void onClick(View v) {
 new RetrieveFeedTask().execute();
 }
 });
 }

 class RetrieveFeedTask extends AsyncTask {

 private Exception exception;
 String mac_address = emailText.getText().toString();
 String key= emailText1.getText().toString();

 protected void onPreExecute() {
 progressBar.setVisibility(View.VISIBLE);
 responseView.setText("");
 }

 protected String doInBackground(Void... urls) {

 // Do some validation here

 try {
 URL url = new URL(API_URL + "mac_address=" + mac_address + "Key=" + key);
 HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
 try {
 BufferedReader bufferedReader = new BufferedReader(new 
InputStreamReader(urlConnection.getInputStream()));
 StringBuilder stringBuilder = new StringBuilder();
 String line;
 while ((line = bufferedReader.readLine()) != null) {
 stringBuilder.append(line).append("\n");
 }
 bufferedReader.close();
 return stringBuilder.toString();
 }
 finally{
 urlConnection.disconnect();
 }
 }
 catch(Exception e) {
 Log.e("ERROR", e.getMessage(), e);
 return null;
 }
 }

 protected void onPostExecute(String response) {
 if(response == null) {
 response = "THERE WAS AN ERROR";
 }
 progressBar.setVisibility(View.GONE);
 Log.i("INFO", response);
 responseView.setText(response);
 // TODO: check this.exception
 // TODO: do something with the feed

// try {
// JSONObject object = (JSONObject) new JSONTokener(response).nextValue();
// String requestID = object.getString("requestId");
// int likelihood = object.getInt("likelihood");
// JSONArray photos = object.getJSONArray("photos");
// .
// .
// .
// .
// } catch (JSONException e) {
// e.printStackTrace();
// }
 }
 }
}


-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/90c19ce6-4349-4ac8-908e-7ee72878e668%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[android-developers] Failed to start the camera on HTC wildfire (Android 2.2.1)

2013-01-22 Thread sameer khan
I have developed the camera app to capture the image and it is working fine.
Someimes when we perform multiple clicks(4-5 times) on cam icon to capture 
the image followed by home button, App unable to start the camera on 
device. Same issue is reflected in default camera app as well.
 
 

https://lh6.googleusercontent.com/-9cR1VC3vkZI/UP6IpmQhdOI/ABY/K5hQJOpTPxA/s1600/scanfront.png
 

-- 
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