Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1018 Bytes

README.md

File metadata and controls

43 lines (35 loc) · 1018 Bytes

MoJcampConverter

MoJcampConverter is a open-source package to convert JCAMP-DX files to spectra.

How to user MoJcampConverter

MoJcampConverter is released as dependency package on jitpack.

1. Add MoJcampConverter to your project

Add jitpack in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

2. Add the dependency

dependencies {
        implementation 'com.github.baolanlequang:jcamp-converter-android:0.0.7'
}

3. Using the converter

val input = assets.open("testdata/test_file_20.dx")

val reader = JcampReader(input)
val jcamp = reader.jcamp
if (jcamp != null) {
    for (spec in jcamp.spectra) {
        Log.d(TAG, spec.xValues.size.toString())
    }
}
else {
    Log.d(TAG, "cannot read jcamp")
}