Android Open Source - innovativeproject-meetingdataexchange Meeting Helper






From Project

Back to project page innovativeproject-meetingdataexchange.

License

The source code is released under:

MIT License

If you think the Android project innovativeproject-meetingdataexchange listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package serverCommunicator;
//from  ww w  .ja  v  a  2  s.  co m
import java.io.IOException;

import org.apache.http.client.ClientProtocolException;
import org.json.JSONException;
import org.json.JSONObject;

import com.TrololoCompany.meetingdataexchangedataBase.MeetingEntity;
import com.TrololoCompany.meetingdataexchangedataBase.ServerEntity;


import android.util.Log;

public class MeetingHelper 
{
  private static final String LOG="MeetingHelper";
  public JSONObject makeJSON2
  (String login,String sid,String title,String topic,String permission)
  {  
    JSONObject json= new JSONObject();
    try {
      json.accumulate("login", login);
      json.accumulate("sid", sid);
      json.accumulate("title", title);
      json.accumulate("topic", topic);
      json.accumulate("abilityToSendFiles", permission);
    } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    return json;
  }
  public synchronized MeetingEntity getMeetingDetails(ServerEntity server,MeetingEntity meeting) throws ClientProtocolException, IOException
  {
    
    Log.i("meeting helper before request",meeting.getTitle()+" "+meeting.getID()+" "+meeting.getServerMeetingID());
    MeetingEntity result_meeting=null;
    CommunicationHelper communicationHelper= new CommunicationHelper();
    String address="http://"+server.getAddress()+"/api/meeting/details/"+
    meeting.getServerMeetingID()+"/"+server.getLogin()+"/"+server.getSid();
    String result=communicationHelper.getHttpGetRequest(address);
    String data[]=parseJSONRespond(result);
    if(data.length>2)
    {
      result_meeting=makeMeeting(data, server);
      
    }
    result_meeting.setID(meeting.getID());
    return result_meeting;

  }
  public MeetingEntity makeMeeting(String input[],ServerEntity server)
  {
    for(int i=0;i<input.length;i++)
    {
      Log.i(LOG,i+" "+input[i]);
    }
    MeetingEntity meeting= new MeetingEntity();
    meeting.setServerId(server.getId());
    meeting.setServerMeetingID(Long.parseLong(input[1]));
    meeting.setTitle(input[2]);
    meeting.setTopic(input[3]);
    meeting.setHostName(input[4]);
    meeting.setStartTime(input[5]);
    meeting.setEndTime(input[6]);
    meeting.setNumberOfMembers(Integer.parseInt(input[7]));
    meeting.setPermission(input[8]);
    meeting.setCode(input[9]);
    
    return meeting;
  }
  public String[] parseJSONRespond(String input)
  {
    JSONObject json;
    String result[] = null ;
    try {
      json = new JSONObject(input);
      Log.i(LOG,"respond received");
      String status=json.getString("status");
      
      Log.i(LOG,"status "+status);
      if(status.contains("failed"))
      {
        result=new String[2];
        result[0]=status;
        result[1]=json.getString("reason");
        Log.i(LOG,"reason "+result[1]);
      }
      else if(status.contains("ok"))
      {
        result=new String[10];
        result[0]=status;
        result[1]=json.getString("meetingid");
        result[2]=json.getString("title");
        result[3]=json.getString("topic");
        result[4]=json.getString("hostname");
        result[5]=json.getString("starttime");
        result[6]=json.getString("endtime");
        result[7]=json.getString("members");
        result[8]=json.getString("permissions");
        result[9]=json.getString("accessCode");

        Log.i(LOG,"ok");
      }
          
    } 
    catch (JSONException e) 
    {
      e.printStackTrace();
    }
    return result;
  }
  
  

  
}




Java Source Code List

Dialogs.ServerOptionsLoggedIn.java
Dialogs.ServerOptionsLoggedOut.java
asynctasks.HttpGetListMeetings.java
asynctasks.HttpGetPersonalData.java
asynctasks.HttpGetServerName.java
asynctasks.HttpPostNewMeeting.java
asynctasks.HttpPostRequestLogInAlreadyExistsUser.java
asynctasks.HttpPostRequestLogInFirstTime.java
asynctasks.HttpPostRequestLogIn.java
asynctasks.HttpPostSignUp.java
asynctasks.HttpPutSendFile.java
asynctasks.RefreshMeetingProgress.java
com.TrololoCompany.meetingdataexchangeAdapters.FileAdapter.java
com.TrololoCompany.meetingdataexchangeAdapters.MeetingAdapter.java
com.TrololoCompany.meetingdataexchangeAdapters.ServerAdapter.java
com.TrololoCompany.meetingdataexchange.AddNewMeetingActivity.java
com.TrololoCompany.meetingdataexchange.AddServerActivityFail.java
com.TrololoCompany.meetingdataexchange.AddServerActivitySuccess.java
com.TrololoCompany.meetingdataexchange.AddServerActivity.java
com.TrololoCompany.meetingdataexchange.DisplayQR.java
com.TrololoCompany.meetingdataexchange.LogInActivity.java
com.TrololoCompany.meetingdataexchange.MainActivity.java
com.TrololoCompany.meetingdataexchange.MeetingDetails.java
com.TrololoCompany.meetingdataexchange.ServerList.java
com.TrololoCompany.meetingdataexchange.ServerManageActivity.java
com.TrololoCompany.meetingdataexchangeServices.MeetingDetailsRefresh.java
com.TrololoCompany.meetingdataexchangeServices.MeetingServerCommunication.java
com.TrololoCompany.meetingdataexchangeServices.ServiceHandlers.java
com.TrololoCompany.meetingdataexchange.SignUpActivity.java
com.TrololoCompany.meetingdataexchange.util.SystemUiHiderBase.java
com.TrololoCompany.meetingdataexchange.util.SystemUiHiderHoneycomb.java
com.TrololoCompany.meetingdataexchange.util.SystemUiHider.java
com.TrololoCompany.meetingdataexchangedataBase.CommentEntity.java
com.TrololoCompany.meetingdataexchangedataBase.DataBaseHelper.java
com.TrololoCompany.meetingdataexchangedataBase.FileEntity.java
com.TrololoCompany.meetingdataexchangedataBase.MeetingEntity.java
com.TrololoCompany.meetingdataexchangedataBase.ServerEntity.java
controllers.Accounts.java
controllers.FilesManagement.java
controllers.GeneralStuff.java
controllers.Mailing.java
controllers.Meetings.java
dataBase.CommentEntity.java
dataBase.DataBaseHelper.java
dataBase.FileEntity.java
dataBase.MeetingEntity.java
dataBase.MettingEntity.java
dataBase.ServerEntity.java
dataBase.Server.java
fileMaintenance.FileMaintenance.java
lists.MeetingList.java
lists.ServerList.java
meeting_options.FireMissilesDialogFragment.java
meeting_options.MeetDetOnPageListener.java
meeting_options.MeetDetTabListener.java
meeting_options.MeetingAddItems.java
meeting_options.MeetingDescription.java
meeting_options.MeetingProgressUIRefresh.java
meeting_options.MeetingProgress.java
meeting_options.MeetingTabPagerAdapter.java
meeting_options.MyOnPageChangeListener.java
meeting_options.MyTabListener.java
meeting_options.RefreshMeetingProgressListView.java
meeting_options.TabsPagerAdapter.java
models.DbSingleton.java
models.DefaultSchema.java
models.Keys.java
models.Tables.java
models.tables.Comment.java
models.tables.File.java
models.tables.Meeting.java
models.tables.Meetinguser.java
models.tables.Session.java
models.tables.SqliteSequence.java
models.tables.User.java
models.tables.records.CommentRecord.java
models.tables.records.FileRecord.java
models.tables.records.MeetingRecord.java
models.tables.records.MeetinguserRecord.java
models.tables.records.SessionRecord.java
models.tables.records.SqliteSequenceRecord.java
models.tables.records.UserRecord.java
serverCommunicator.CheckIsServerExists.java
serverCommunicator.CommentsHelper.java
serverCommunicator.CommunicationHelper.java
serverCommunicator.Communication.java
serverCommunicator.FileHelper.java
serverCommunicator.FileListRefreshService.java
serverCommunicator.GetMeetingListHelper.java
serverCommunicator.GetPersonalDataHelper.java
serverCommunicator.HttpGetRequest.java
serverCommunicator.HttpPostRequest.java
serverCommunicator.LogInHelper.java
serverCommunicator.MeetingHelper.java
serverCommunicator.NewMeetingHelper.java
serverCommunicator.RegistrationHelper.java
tools.MD5Checksum.java