コード例 #1
0
ファイル: Main.java プロジェクト: DBezemer/server
    @Override
    protected Void doInBackground(Void... params) {
      // Test for connection
      try {
        if (Utils.checkInternetConnection(getApplicationContext())) {
          /** Getting list of all categories */
          publishProgress(States.LOADING_DATA);

          if (pathfromURI != null
              && category != null
              && title != null
              && description != null
              && tags != null) {
            message = "Create new entry";
            KalturaMediaEntry newEntry =
                Media.addEmptyEntry(TAG, category, title, description, tags);
            message = "Uploading data";
            isUploaded =
                uploadToken.uploadMediaFileAndAttachToEmptyEntry(TAG, newEntry, pathfromURI);
          } else {
            message = "data null";
            publishProgress(States.ERR);
          }
        }
      } catch (Exception e) {
        e.printStackTrace();
        message = e.getMessage();
        Log.w(TAG, message);
        publishProgress(States.NO_CONNECTION);
      }
      return null;
    }
コード例 #2
0
ファイル: Main.java プロジェクト: DBezemer/server
 @Override
 protected Void doInBackground(Void... params) {
   // Test for connection
   try {
     if (Utils.checkInternetConnection(getApplicationContext())) {
       /** Getting list of all categories */
       publishProgress(States.LOADING_DATA);
       listCategory = Category.listAllCategories(TAG, 1, 500);
     }
   } catch (KalturaApiException e) {
     e.printStackTrace();
     message = e.getMessage();
     Log.w(TAG, message);
     publishProgress(States.ERR);
   } catch (Exception e) {
     e.printStackTrace();
     message = e.getMessage();
     Log.w(TAG, message);
     publishProgress(States.NO_CONNECTION);
   }
   return null;
 }