How to generate Sup sound

Yo! Clone for Android
DroidMaster
Posts: 74
Joined: Wed Aug 26, 2015 8:32 am

How to generate Sup sound

Postby DroidMaster » Wed Sep 09, 2015 9:23 am

Hi,
I installed Sup project in Android studio working fine.
I need to understand how sound will generate when click on particular Sup user.explain me with code?

Sharan
Posts: 15
Joined: Mon Aug 24, 2015 2:05 pm

Re: How to generate Sup sound

Postby Sharan » Sun Sep 13, 2015 7:26 am

    Hi,
    To generate Sup sound when click on particular Sup user follow below steps.
  1. In Sup project find InviteActivity.
  2. In InviteActivity find onClickFrontView method .
  3. To call API from server to generate Sup sound we using asynctask using following code inside the onClickFrontView method.

    Code: Select all

    new SendSupAsync().execute(SupList.unBlockSups.get(position).getMySupName());
  4. Following code is used in SendSupAsync class to send request to the server.

    Code: Select all

    class SendSupAsync extends AsyncTask<String, String, String>{
          String response;
          SupJsonParsing jsonParsingForGetSup;
          HttpRequest httpRequest = null;

          @Override
          protected String doInBackground(String... params) {
             ArrayList<NameValuePair> list = new ArrayList<NameValuePair>();
             list.add(new BasicNameValuePair(JsonSignupKey.USERNAME,loggedInUserName));
             list.add(new BasicNameValuePair(JsonSignupKey.ADD_SUP_NAME,params[0]));
             try {
                httpRequest = new HttpRequest();
                Log.d("pavan","in send su[p api "+list.get(0)+" "+list.get(1));

                response = httpRequest.postData(Urls.SEND_SUP, list);

             } catch (Exception e) {

                e.printStackTrace();
             }

             return null;
          }

          @Override
          protected void onPostExecute(String result) {
             // TODO Auto-generated method stub
             super.onPostExecute(result);

          }
       
       }

    In the above code sending loggedin user name and Sup username to server to generate Notification and Sup sound.


Return to “Sup”

Who is online

Users browsing this forum: No registered users and 1 guest