2

I'm not experienced in Android and I'm trying to create a very simple application using Samsung S-Pen SDK 2.3. I'm following this tutorial from Samsung developers website. When I implement the most basic example I get the following error.

WARNING: Could not load libjni_secime natives
No implementation found for native Lcom/bst/HwBeautify/BeautifyNative;.nativeCBInitEngine:()I
threadid=11: thread exiting with uncaught exception (group=0x41a242a0)
...

FATAL EXCEPTION: Thread-1829
java.lang.UnsatisfiedLinkError: Native method not found: com.bst.HwBeautify.BeautifyNative.nativeCBInitEngine:()
at com.bst.HwBeautify.BeautifyNative.nativeCBInitEngine(Native Method)
at com.bst.HwBeautify.BeautifyNative.cbInitEngine(SourceFile:107)
at com.bst.HwBeautify.BeautifyManager.b(SourceFile:87)
at com.bst.HwBeautify.BeautifyManager.a(SourceFile:85)
at com.bst.HwBeautify.BeautifyManager$1.run(SourceFile:64)
at java.lang.Thread.run(Thread.java:856)
...
S-Canvas is not created yet. Call "changeModeTo" in onInitialized() of SCanvasInitializeListener or call it after onInitialized() SCanvasLayout is up to been initailized
... No implementation found for native Lcom/bst/HwBeautify/BeautifyNative;.nativeCBInitEngine:()I threadid=16: thread exiting with uncaught exception (group=0x41a242a0)

Here the whole code for the activity that is supposed to initialize canvas:

package com.example.canvastest;

import com.samsung.spensdk.SCanvasView;

import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.widget.RelativeLayout;

public class CanvasSpace extends Activity {


    private Context mContext;
    private RelativeLayout mCanvasContainer;
    private SCanvasView mSCanvas;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_canvas_space);

        mContext = this;

        mCanvasContainer = (RelativeLayout) findViewById(R.id.canvas_container);
        mSCanvas = new SCanvasView(mContext);

        mCanvasContainer.addView(mSCanvas);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.canvas_space, menu);
        return true;
    }


}

And here is my layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".CanvasSpace" >

    <RelativeLayout 
            android:id="@+id/canvas_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center">        
    </RelativeLayout>

</RelativeLayout>

What concerns me is this very weird S_Pen_SDK2.3 folder structure. Instead of normal directories I have filenames with paths (705 items).

SDK Folder

I have never seen anything like this. Why would anybody do something like this? Are there any benefits of having folder structured like this? Anyways, I follow the tutorial, I reference the library and include files in armeabi folder as specified. Here is the view of my package explorer:

Package explorer

I searched the web and I found a thread on Samsung developers that addresses this problem but it doesn't help in my case. What I tried so far was to remove those paths before filenames in armeabi folder but that didn't help. That would help me very much if somebody gave me some hints of how do I get it to work. I included so much obvious code and screenshots to make it perfectly clear what do I have in my project.

Booyaches
  • 1,669
  • 4
  • 27
  • 40

1 Answers1

5

The library is imported in the wrong way, that's why you get the exception.

Copy the libspen23.jar and also the whole armeabi directory to the libs.

It should looks like this:

libs  
   armeabi
      lib* (all .so files)
   libspen23.jar

Look at the samples provided with the S Pen SDK 2.3, which shows how to properly import the library.

tomrozb
  • 25,773
  • 31
  • 101
  • 122
  • Aaaa. I'm so ashamed now. However, when I read it again its not that clear in the tutorial that `armeabi` folder should be in `libs` directory. Thank you so much! – Booyaches Mar 10 '13 at 07:24