How to use playoutDelayHint and jitterBufferDelayHint in a Native WebRtc Java project - java

I'm currently using a self compiled WebRtc lib for my Android project and I try to get lowest latency for game streaming/ cloud gaming. I found out that on browsers you can use playoutDelayHint and or jitterBufferDelayHint to fine tune latency and how the underlying peer connection will handle things.
https://discourse.wicg.io/t/hint-attribute-in-webrtc-to-influence-underlying-audio-video-buffering/4038
Unfortunately I have no idea of how to use these functionality within a native WebRtc project (no browser)?
Is there a way to access and modify these flags in a native project and if not what actually must be adjusted in the WebRtc lib to achieve the same result? As I compile the WebRtc lib by my own I could just add this functionality by my own, I just don't have any idea what the playoutDelayHint and jitterBufferDelayHint flag is modifying in the background?
I found this in the native code which could be the correct part for the playbackDelayHint but not sure
https://github.com/maitrungduc1410/webrtc/blob/c2b1bad4c87a43d7e1af85e809d5abe04baf3104/api/video/video_timing.h#L116

Related

Using existing Java code with React Native

I'm pretty new to React Native and mobile development in general. But I have a simple Java library with junit tests and I want to do one of two things:
1) I want to convert this Java code to be used naturally with React Native for development on iOS and Android.
2) I want to use this java code to be used only with Android in a native-hybrid application.
I probably have a few gaps in my understanding of how all this works. I understand that Java is native for Android, and therefore is only used for Android development. React native bridges the cross-platform gap to decompile react native code into platform specific code.
If I wanted to use my Java code for development on iOS, does that happen through Native Modules? Is it possible to do regardless?
If it is only to be used on Android (which is fine), is using the setup described in the Native Modules section on React Native's website the way to go?
Thanks!
As far as I know, You cannot directly deploy code written by java to both Android and IOS in react-native. You can do it only for Android specific parts in react-native. If you want to use it as IOS compatible, you need to write a native module from IOS natives.
If u want to deploy your native Android module you can follow this https://hackernoon.com/first-experiences-with-react-native-bridging-an-android-native-module-for-app-authentication-501fec247b2b detailed example
If u want to create both android and IOS native modules u can follow this https://medium.com/#FizzyInTheHall/writing-a-react-native-bridge-library-bce5b90ea6d0 example

Using MonkeyRunner with Java/Eclipse

I am trying to build a program with Eclipse that will send touch events via MonkeyRunner to an Android phone. However, I can't figure out how to get MonkeyRunner to work. I searched for questions similar to mine and found that there were several .jar dependencies, and I added them to Libraries under the Java Build Path, but it still fails (cannot be resolved) to do
import com.android.monkeyrunner.adb.AdbBackend;
import com.android.monkeyrunner.core.IMonkeyDevice;
import com.android.monkeyrunner.core.TouchPressType;
What else am I missing besides adding the .jars to the libraries?
If your intention is to send events from Java to a device you should use UIAutomator from the Testing Support Library.
UIAutomator provides a set of APIs to build tests that allow you to send events and interact with the applications on the device.
Building with Eclipse may be difficult but not impossible, or you can use Android Studio and make your life easier.
However, if you just want to send events to the device and want to use a scripting language like python instead of Java, you can use AndroidViewClient/culebra which facilitates the creation of tests and scripts from a UI (see Culebra UI). It can also be used from Eclipse using PyDev or PyCharm.

Java Library in Android Project

I want to make a java library (so I can compile it into a jar) that makes calls to a server. I then want to share this amongst android application projects so that I can access those simple calls.
Is using HTTPRequest the best way to do this?
http://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html
Something about making web calls in the java way and sharing them in android apps seems odd to me. should this be an Android Library instead? (I believe those should only be used when resources are involved)
Sorry for the potentially simple question.
You can develop a common Java library that you can use with both android , and regular java projects.
Take a look at OkHttp , it shows you how to achieve this. It is related to HTTP client, may be it already provides everything you need. You can extend it where needed.
For a simpler example (~20 java classes), take look at Okio , the underlying io library used by OkHttp.

How to make Android App from existing JAva Code?

I have a multiplayer Chess program and I wanted to know if there is an easy way to make an app for it. If I worth with Android SDKs on Eclipse, do I have to code the whole thing again or I can just use the Java code for making the app?
It depends on what libraries you're using in your game and their support in Android.
If you use Java for the existing implementation, you'll hopefully, have to write the UI bits, and the erst of the logic should simply work.
If this is a desktop app you're trying to port, you may have performance issues (given you're running on a mobile device now), so there would be some changes necessary.
If you're using any graphics libraries, check their support on Android. Some libraries have a reputation of having issues on Android.
I solved it myself. You just need to insert your JS files or you could use the Url of your uploaded app.

Porting C code to Android

I am at the very start of a project where we are trying to write an application for an android smartphone that will call a shared library written in C.
It seems that the way to do this is to use the Android NDK to build the library in a binary format compatible with the smartphone hardware then use JNI to call the shared library from Java. Possibly using SWIG along the way to facilitate with the JNI wrapper functions.
But before I go down this route, am I missing any, potentially much simpler, approaches to getting a C app to run on a smartphone? What got me thinking that there may be other alternatives was the Canonical project looking to run ubuntu on a smartphone (http://www.ubuntu.com/devices/android) but it doesn't seem to be available yet.
Any lateral thoughts on this topic gratefully received
As far as I know, the NDK is the preferred route to follow when using native code in android. You can also build a java wrapper library around your C code, separate from your Android project, and include that .jar in your Android app. This uses standard Java instead of Google's NDK, and I have used several libraries built in this manner in android with very little effort.

Categories