Loading a compiled .jar library into an Android Project
<h1>UPDATE</h1>

<p>This is the correct way to add a compiled library:</p>

<ol>
<li>Download the compiled .jar (and any extra files)</li>
<li>Add the jar (and anything extra) to a folder called <code>libs</code> in the project.</li>
<li>Right click on the project and configure build path</li>
<li>Libraries -> Add jar -> choose the jar</li>
<li>...</li>
<li>Profit</li>
</ol>

<h1>ORIGINAL QUESTION</h1>

<p>Has anyone come across this before?</p>

<p><a href="http://code.google.com/p/aacdecoder-android/" rel="nofollow">http://code.google.com/p/aacdecoder-android/</a></p>

<p>I am trying (desperately) to get it to work. Here are the steps I've followed:</p>

<ol>
<li>Download the compiled .jar and .so files from downloads (the top one <code>aacdecoder-android-libs-0.5.zip</code>).</li>
<li>Add the two files to a folder called <code>lib</code> in the project.</li>
<li>Right click on the project and configure build path</li>
<li>Libraries -> Add jar -> choose the jar</li>
</ol>

<p>I've put in the sample code on the google code page and yet I'm getting this error:</p>

<pre><code>W/dalvikvm(  405): threadid=3: thread exiting with uncaught exception (group=0x4001aa28)
E/AndroidRuntime(  405): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime(  405): java.lang.UnsatisfiedLinkError: Library aacdecoder not found
E/AndroidRuntime(  405):    at java.lang.Runtime.loadLibrary(Runtime.java:489)
E/AndroidRuntime(  405):    at java.lang.System.loadLibrary(System.java:557)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.Decoder.loadLibrary(Decoder.java:167)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.Decoder.create(Decoder.java:188)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.Decoder.create(Decoder.java:178)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.AACPlayer.createDecoder(AACPlayer.java:407)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.AACPlayer.&lt;init&gt;(AACPlayer.java:121)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.AACPlayer.&lt;init&gt;(AACPlayer.java:104)
E/AndroidRuntime(  405):    at com.spoledge.aacdecoder.AACPlayer.&lt;init&gt;(AACPlayer.java:95)
E/AndroidRuntime(  405):    at com.tclayson.furadio.FURadioActivity.onCreate(FURadioActivity.java:14)
E/AndroidRuntime(  405):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
E/AndroidRuntime(  405):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
E/AndroidRuntime(  405):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
E/AndroidRuntime(  405):    at android.app.ActivityThread.access$2100(ActivityThread.java:116)
E/AndroidRuntime(  405):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
E/AndroidRuntime(  405):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(  405):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(  405):    at android.app.ActivityThread.main(ActivityThread.java:4203)
E/AndroidRuntime(  405):    at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(  405):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(  405):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime(  405):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime(  405):    at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p>What am I doing wrong?! Can anyone help? Can anyone get that particular library to work at all? I need to play an AAC stream (eg: <a href="http://media-ice.musicradio.com/Capital" rel="nofollow">http://media-ice.musicradio.com/Capital</a>).</p>

<p>Thanks</p>

<p><strong>UPDATE</strong></p>

<p>I added the library files (the .jar and the .so) to a different folder <code>libs</code> this time (with <code>s</code>).</p>

<p>Going through the same steps as above produces this new error:</p>

<pre><code>D/ddm-heap(  436): Got feature list request
D/dalvikvm(  436): Trying to load lib /data/data/com.tclayson.furadio/lib/libaacdecoder.so 0x4376acc8
D/dalvikvm(  436): Added shared lib /data/data/com.tclayson.furadio/lib/libaacdecoder.so 0x4376acc8
D/dalvikvm(  436): No JNI_OnLoad found in /data/data/com.tclayson.furadio/lib/libaacdecoder.so 0x4376acc8
I/InetAddress(  436): Unknown host media-ice.musicradio.com, throwing UnknownHostException
E/AACPlayer(  436): playAsync():
E/AACPlayer(  436): java.net.SocketException: Permission denied (maybe missing INTERNET permission)
E/AACPlayer(  436):     at org.apache.harmony.luni.platform.OSNetworkSystem.createSocketImpl(Native Method)
E/AACPlayer(  436):     at org.apache.harmony.luni.platform.OSNetworkSystem.createSocket(OSNetworkSystem.java:85)
E/AACPlayer(  436):     at org.apache.harmony.luni.net.PlainSocketImpl2.create(PlainSocketImpl2.java:59)
E/AACPlayer(  436):     at java.net.Socket.checkClosedAndCreate(Socket.java:829)
E/AACPlayer(  436):     at java.net.Socket.connect(Socket.java:984)
E/AACPlayer(  436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.&lt;init&gt;(HttpConnection.java:67)
E/AACPlayer(  436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager$ConnectionPool.getHttpConnection(HttpConnectionManager.java:151)
E/AACPlayer(  436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionManager.getConnection(HttpConnectionManager.java:73)
E/AACPlayer(  436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getHTTPConnection(HttpURLConnection.java:826)
E/AACPlayer(  436):     at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:812)
E/AACPlayer(  436):     at com.spoledge.aacdecoder.AACPlayer.play(AACPlayer.java:259)
E/AACPlayer(  436):     at com.spoledge.aacdecoder.AACPlayer$1.run(AACPlayer.java:230)
E/AACPlayer(  436):     at java.lang.Thread.run(Thread.java:1060)
</code></pre>

<p>What is the problem here? I don't understand the <code>Unknown host</code> error, because its evident that the above url exists. If this is a library specific issue then don't worry. :/</p>
