Using AndroidAsync in my project - android

I'm following a tutorial where they want me to use android websockets library, unfortunately this library is deprecated and I should now use AndroidAsync.
This should be an easy task for the common Android Developer, but I'm kinda new to Android Development so I would like some help doing this.
I have posted my code as a pastebin because the code is too big to post here.
My code:
http://pastebin.com/dYNAG6eX
The library is already imported into the project, I just need some help changing the code to the correct things.

Related

How to implement herumi/mcl library into my Android project?

I would like to use herumi/mcl library in my Android project. I posted a question on Author's forum and he replied with these two solutions:
1. https://github.com/herumi/bls-eth-go-binary/ provides a static library for Android, which contains mcl functions. You can use them through gomobile .
2. https://github.com/herumi/mcl/tree/master/ffi/java provides JNI of mcl. If you can build libmcljava.so for Android by cross-compile, then you can use mcl such as https://github.com/herumi/mcl/blob/master/ffi/java/MclTest.java.
I think that great solution for me is the second Option, but i absolutely dont know how. I am using Android NDK to call C code to my app, but thats all i know.
I am looking for some fresh tutorial or something like step-by-step, what would help me to use this library in my Android project. I am working on Windows OS.

Android MVVM sample architecture project required

I am new to android MVVM architecture. Can I get any sample project from where I can follow folder structure for the implementation. I want to call REST Apis from the app. But I didn't find any good sample. Please let me know any good projects ti refer (Apart from google samples)
Like others mentioned, Google would be the first place to search this kind of stuff. As you mentioned, there are MVVM samples provided by Google on GitHub. However, they are a bit complicated to understand due to the project being really large. I believe this that this sample project is much easier to understand and does a good job explaining MVVM: https://proandroiddev.com/mvvm-architecture-viewmodel-and-livedata-part-1-604f50cda1.
Hopefully this helps!

How should I do to implement webrtc for native mobile

Now I just looking for any native library that helps me to implement webrtc with native mobile codes (Android Java, iOS Swift)
As I saw that libjingle have no updates around a year I does not sure that I still should use it, I don't want to use webrtc with third-party api such as Pubnub.
How about you guys suggestion or libjingle is good enough ?
Sample are available in the official documentation. Refer https://webrtc.github.io/samples/
libjingle has been "dead" since 2012, all relevant code moved over to https://webrtc.org which, unlike libjingle, has reasonably good instructions for checking out and building on mobile at https://webrtc.org/native-code/
Now the recommended way is to add the official library as dependency to your project.
implementation 'org.webrtc:google-webrtc:1.0.+'
You may refer the AppRTCMobile sample project which can be build by following the instructions given here - https://webrtc.org/native-code/android/
There are sample projects on GitHub which have already done the hard work for you. I found this one to be updated for Oreo.

I'm looking for a BOSH XMPP library for Android

I recently wrote a Facebook Chat App for Android using Smack, which is an excellent library and it worked great for that app. I'm currently working on my next chat project on Android and would like to do BOSH, but Smack doesn't support it. I've found a development branch talked about here:
http://community.igniterealtime.org/thread/40768
I was hoping there was something out there that was more stable. Has anyone else found anything?
Thanks!
Every asmack fork I know contains the SMACKs BOSH patches. I have never used them, but I am also not aware of any alternative library that implements BOSH for the Android platform.
To produce custom jars which has got support for BOSH connection. These jars can be found at https://github.com/rajesh-kumar/amqp-xmpp-bosh/tree/master/lib/

How to add java.awt.image package in Android

I have an external library that relies on the java.awt.Image package. However, the Android library does not contain it. Does anybody know how to add it to Android?
Thanks!
The Java AWT classes contain native code, so unless someone ports that native code to Android, you are out of luck. And, they won't port it, because as it was pointed out above, Android has its own graphics libraries (android.graphics).
Use JavaCV. http://code.google.com/p/javacv/
Its allready precompiled for Android 2.2 : http://code.google.com/p/javacv/downloads/list
This answer is to justify Hitesh answer after seeing up votes (which misleads). If am wrong, please correct me.
Well, I have also been enthusiast in using few core concepts of Java like Swings and AWT libraries in Android.
Recently I wanted to use java.awt.Color class because it is much better than android.graphics.Color. So done a small research by reading few threads and concluded as 'No we cannot import'. By seeing Hitesh answer I thought I failed my research and found very easiest solution for my problem. Followed the steps for a sample and run my code. Alas!!!
NoClassDefFoundError exception has thrown.
Once again made a small research for concluding Jeffrey (accepted) answer. I found conclusion here. The comment above the method loadLibraries() explains everything. This method has been called in Color class (line 279).
https://stackoverflow.com/a/33210293/5418475
The AWT package is not supported in Android, you need to change your implementation to use the Android classes.
See these similar questions:
Porting AWT graphics code to Android
How to add java AWT image package in Android
Using AWT with Android

Categories

Resources