Android Open Source - rsmonitor-heartrate Run Encoder






From Project

Back to project page rsmonitor-heartrate.

License

The source code is released under:

GNU General Public License

If you think the Android project rsmonitor-heartrate 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 com.renaultsport.heartrate.utils;
//from ww w  .  java 2  s  . c  o m
import java.io.File;
import java.util.Date;

import android.os.Environment;




public class RunEncoder
{
  public native int  start_jni  (String szFilename);
  public native int  add_jni    (int iChannel, String szValue);
  public native int  encode_jni  ();
  public native void  stop_jni  ();

  static { System.loadLibrary ("run_encode_jni"); }




  private String m_szPathVideo  = null;




  public int start ()
  {
    int iResult = 0;

    m_szPathVideo = getOutputRunFile ();

    try { iResult = start_jni (m_szPathVideo); }
    catch (UnsatisfiedLinkError exception) { iResult = -1; }

    return iResult;
  }

  public int add (int iChannel, int nValue)
  {
    int iResult = 0;

    try { iResult = add_jni (iChannel, String.valueOf (nValue)); }
    catch (UnsatisfiedLinkError exception) { iResult = -1; }

    return iResult;
  }

  public int encode ()
  {
    int iResult = 0;

    try { iResult = encode_jni (); }
    catch (UnsatisfiedLinkError exception) { iResult = -1; }

    return iResult;
  }

  public void stop ()
  {
    try { stop_jni (); }
    catch (UnsatisfiedLinkError exception) { }
  }




  private String getOutputRunFile ()
  {
    File directory  = null;
    File runFile  = null;


    directory = new File (Environment.getExternalStorageDirectory ().getAbsolutePath () + File.separator + Constants.SDCARD_PATH);
    if (! directory.exists ()) { directory.mkdirs (); }

    runFile = new File (directory.getPath () + File.separator + Constants.SDCARD_RUN_FILE + new Date ().getTime () + Constants.SDCARD_RUN_EXTENSION);

    return runFile.getAbsolutePath ();
  }
}




Java Source Code List

com.facebook.android.AsyncFacebookRunner.java
com.facebook.android.BaseDialogListener.java
com.facebook.android.BaseRequestListener.java
com.facebook.android.DialogError.java
com.facebook.android.FQLQuery.java
com.facebook.android.FacebookError.java
com.facebook.android.FacebookFunctions.java
com.facebook.android.Facebook.java
com.facebook.android.FbDialog.java
com.facebook.android.FieldsConnectionsDialog.java
com.facebook.android.FriendsGetProfilePics.java
com.facebook.android.FriendsList.java
com.facebook.android.GraphExplorer.java
com.facebook.android.IntentUriHandler.java
com.facebook.android.LoginButton.java
com.facebook.android.PermissionsDialog.java
com.facebook.android.Places.java
com.facebook.android.SessionEvents.java
com.facebook.android.SessionStore.java
com.facebook.android.TokenRefreshDialog.java
com.facebook.android.UpdateStatusResultDialog.java
com.facebook.android.UploadPhotoResultDialog.java
com.facebook.android.Util.java
com.facebook.android.Utility.java
com.googlecode.android.widgets.DateSlider.AlternativeDateSlider.java
com.googlecode.android.widgets.DateSlider.CustomDateSlider.java
com.googlecode.android.widgets.DateSlider.DateSlider.java
com.googlecode.android.widgets.DateSlider.DateTimeSlider.java
com.googlecode.android.widgets.DateSlider.DefaultDateSlider.java
com.googlecode.android.widgets.DateSlider.MonthYearDateSlider.java
com.googlecode.android.widgets.DateSlider.ScrollLayout.java
com.googlecode.android.widgets.DateSlider.TimeSlider.java
com.googlecode.android.widgets.DateSlider.TimeView.java
com.renaultsport.heartrate.ActivityMain.java
com.renaultsport.heartrate.ActivityRecord.java
com.renaultsport.heartrate.ActivitySplash.java
com.renaultsport.heartrate.ActivityUpload.java
com.renaultsport.heartrate.ActivityVideoReader.java
com.renaultsport.heartrate.ActivityWarning.java
com.renaultsport.heartrate.MainApplication.java
com.renaultsport.heartrate.utils.CaptureCamera.java
com.renaultsport.heartrate.utils.ClientThread.java
com.renaultsport.heartrate.utils.Constants.java
com.renaultsport.heartrate.utils.RunEncoder.java
team.stride.tabs.TabGroupActivity.java