Java Code Examples for com.flurry.android.FlurryAgent#onError()

The following examples show how to use com.flurry.android.FlurryAgent#onError() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BassPlayer.java    From freemp with Apache License 2.0 6 votes vote down vote up
@Override
public void DOWNLOADPROC(ByteBuffer buffer, int length, Object user) {
    //&& (Integer)user == req
    if (filePath != null) {
        try {
            if (buffer != null) {
                if (fc == null)
                    fc = new FileOutputStream(new File(filePath)).getChannel();
                fc.write(buffer);
            } else if (fc != null) {
                fc.close();
                fc = null;
            }
        } catch (IOException e) {
            FlurryAgent.onError("5", "5", e);
        }
    }

}
 
Example 2
Source File: ServicePlayer.java    From freemp with Apache License 2.0 6 votes vote down vote up
public void onPlayError(String e) {
    // Update Properties
    this.duration = 0.0;
    this.progress = 0.0;

    // Notify activity
    if (activity != null && tracks != null && tracks.size() > position) {
        activity.onFileLoaded(tracks.get(position), this.duration, "", "", 0, 0);
        activity.onProgressChanged(progress);
        activity.onUpdatePlayPause();
    }

    stopUpdateProgress();

    //skip 1st n errors on play
    if (errorCount < 3) {
        errorCount++;
        playNext();
    } else {
        FlurryAgent.onError("onPlayError", e, "");
        stop();
    }
}
 
Example 3
Source File: FlurryModule.java    From react-native-flurry-sdk with Apache License 2.0 4 votes vote down vote up
@ReactMethod
public void onError(String errorId, String message, String errorClass) {
    FlurryAgent.onError(errorId, message, errorClass);
}
 
Example 4
Source File: FlurryModule.java    From react-native-flurry-sdk with Apache License 2.0 4 votes vote down vote up
@ReactMethod
public void onErrorParams(String errorId, String message, String errorClass,
                          ReadableMap errorParams) {
    FlurryAgent.onError(errorId, message, errorClass, toMap(errorParams));
}
 
Example 5
Source File: FillMediaStoreTracks.java    From freemp with Apache License 2.0 4 votes vote down vote up
public FillMediaStoreTracks(Context context) {
    tempAllTracksMediaStore = new ArrayList<ClsTrack>();
    String selection = MediaStore.Audio.Media.IS_MUSIC + " != 0";

    String[] projection = {
            MediaStore.Audio.Media.ARTIST,
            MediaStore.Audio.Media.TITLE,
            MediaStore.Audio.Media.ALBUM,
            MediaStore.Audio.Media.COMPOSER,
            MediaStore.Audio.Media.YEAR,
            MediaStore.Audio.Media.TRACK,
            MediaStore.Audio.Media.DURATION,
            MediaStore.Audio.Media.DATA,
            MediaStore.Audio.Media.ALBUM_ID
    };
    Cursor cursor = null;
    try {
        cursor = context.getContentResolver().query(
                MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
                projection,
                selection,
                null,
                null);

        while (cursor != null && cursor.moveToNext()) {

            String folder = "";
            String path = cursor.getString(7);
            String[] pathArray = path.split(
                    TextUtils.equals(System.getProperty("file.separator"), "") ? "/" : System.getProperty("file.separator")
            );
            if (pathArray != null && pathArray.length > 1) {
                folder = pathArray[pathArray.length - 2];
            }

            tempAllTracksMediaStore.add(new ClsTrack(
                    cursor.getString(0),
                    cursor.getString(1),
                    cursor.getString(2),
                    cursor.getString(3),
                    cursor.getInt(4),
                    cursor.getInt(5),
                    (cursor.getInt(6) / 1000),
                    cursor.getString(7),
                    folder,
                    new File(path).lastModified(),
                    cursor.getInt(8)
            ));
        }
        if (cursor != null) {
            cursor.close();
        }
    } catch (Exception e) {
        FlurryAgent.onError("1", "1", e.toString());
        try {
            cursor.close();
        } catch (Exception ee) {
        }
        //e.printStackTrace();
    }

    FileUtils.writeObject("alltracksms", context, tempAllTracksMediaStore);
}