-
Notifications
You must be signed in to change notification settings - Fork 18
Expand Android Getting Started documentation #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7fd13c9
Add unit testing framework in list of PJLIB API
bennylp a587fa3
Minor update to README
bennylp c814611
Initial outline draft
bennylp e55dc6c
Done first sample app
bennylp 9bb6474
Done Android CLI doc, plus move samples to own dir, and update copyri…
bennylp 832dc72
Android: done last section
bennylp 43bb266
Updated from review comments
bennylp cc38ce7
Expand the docs on project modules
bennylp b96953e
Minor typos
bennylp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Usage: | ||
| # cat KEYWORDS | check-keywords.sh | ||
|
|
||
| echo "#files #matches keywords" | ||
| echo "--------------------------------------" | ||
|
|
||
| while read -r line; do | ||
| file_count=`grep -iwl --no-filename "$line" *.rst | wc -l` | ||
| word_count=`grep -iw --no-filename "$line" *.rst | wc -l` | ||
| echo -e "$file_count\t$word_count\t $line" | ||
| done | sort -nr | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1 @@ | ||
| All Samples | ||
| =================== | ||
| .. toctree:: | ||
| :maxdepth: 1 | ||
|
|
||
| .. include:: /api/pjsua2/samples.rst | ||
|
|
||
| .. include:: /api/pjsua-lib/samples.rst | ||
|
|
||
| .. include:: /api/pjsip/samples.rst | ||
|
|
||
| .. include:: /api/pjmedia/samples.rst | ||
|
|
||
| .. include:: /api/pjnath/samples.rst | ||
| .. include:: /samples/index.rst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| - support for multiple SIP accounts, | ||
| - call features such as voice and video call, call hold, call transfer, both attended and unattended, | ||
| call redirection, | ||
| - protocol features such as UPDATE, 100rel, PRACK, tel: URI, Session Timers, | ||
| outbound, Path header, IPv6, DNS SRV resolution, | ||
| - NAT traversal features such as symetric transport, SIP outbound, Service-Route, ICE and trickle ICE option, | ||
| - presence and instant messaging, | ||
| - security related, such as digest, AKA, AKA-v2, OAuth 2.0 authentication, TLS transport |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| android | ||
| api | ||
| client | ||
| dialer | ||
| library | ||
| open source | ||
| portable | ||
| sample | ||
| SDK | ||
| softphone | ||
| source code | ||
| stack | ||
| video call | ||
| voip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| Creating your own application | ||
| ======================================= | ||
|
|
||
| .. contents:: In this page: | ||
| :depth: 2 | ||
| :local: | ||
|
|
||
|
|
||
|
|
||
| .. _android_create_app: | ||
|
|
||
| Creating your own application | ||
| ------------------------------------------ | ||
|
|
||
| Creating your own Android SIP application based on PJSIP typically involves the following steps. | ||
|
|
||
| #. We assume that PJSIP native libraries have been built by following the previous guide in | ||
| :doc:`/get-started/android/build_instructions`, including the JNI (SWIG) interface. | ||
| #. Create Android application outside the PJSIP sources for your project. | ||
| #. Copy ``libpjsua2.so`` and ``libc++_shared.so`` to your **jniLibs/$ARCH** directory: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| $ cd $YOUR_PROJECT_DIR/app/src/main/jniLibs | ||
| $ cp -r $PJSIP_DIR/pjsip-apps/src/swig/java/android/pjsua2/src/main/jniLibs/* . | ||
| $ ls -R | ||
| arm64-v8a | ||
|
|
||
| ./arm64-v8a: | ||
| libcrypto.so libc++_shared.so liboboe.so libpjsua2.so libssl.so | ||
|
|
||
| #. You will see the third party libs (OpenSSL, Oboe) in the ``ls`` output above if you have followed the | ||
| previous tutorial to develop the sample Java application. If you only see ``libpjsua2.so`` and | ||
| ``libc++_shared.so``, follow the guide in :ref:`android_copy_3rd_party_libs`. After | ||
| that, you should see the **jniLibs** contents like above. | ||
| #. Copy pjsua2 Java interface files from ``pjsip-apps/src/swig/java/android/app/src/main/java`` to your | ||
| project's ``app/src/main/java`` folder, e.g: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| $ cd $YOUR_PROJECT_DIR/app/src/main/java | ||
| $ cp -r $PJSIP_DIR/pjsip-apps/src/swig/java/android/app/src/main/java/* . | ||
|
|
||
| # check | ||
| $ ls | ||
| org | ||
|
|
||
| # Cleanup excess pjsua2 application sources. | ||
| $ rm -r org/pjsip/pjsua2/app | ||
|
|
||
| #. Start writing your application, by following these guides: | ||
|
|
||
| - :doc:`pjsua2 Guide </pjsua2/intro>` | ||
| - :doc:`pjsua2 API reference and samples </api/pjsua2/index>` | ||
|
|
||
|
|
||
|
|
||
| Adding Video Capture Device to Your Application | ||
| ------------------------------------------------------- | ||
|
|
||
| Copy the java part of PJSIP Android capture device to the application's source | ||
| directory: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| cp pjmedia/src/pjmedia-videodev/android/PjCamera*.java [your_app]/src/org/pjsip/ | ||
|
|
||
|
|
||
| Since 2.12, the capture device uses ``Camera2`` API (see also :pr:`2797` for | ||
| more info), application need to configure the ``CameraManager`` instance | ||
| in ``PjCameraInfo2`` before using the camera, e.g: | ||
|
|
||
| .. code-block:: java | ||
|
|
||
| @Override protected void onCreate(Bundle savedInstanceState) | ||
| { | ||
| //.. | ||
| CameraManager cm = (CameraManager)getSystemService(Context.CAMERA_SERVICE); | ||
| PjCameraInfo2.SetCameraManager(cm); | ||
| //.. | ||
| } | ||
|
|
||
|
|
||
|
|
||
| Using Video API | ||
| ----------------------------------- | ||
| Please check :doc:`Working with Video </pjsua2/using/media_video>` (PJSUA2 Guide). | ||
|
|
||
|
|
||
| Video capture orientation support | ||
| ------------------------------------------- | ||
|
|
||
| To send video in the proper orientation (i.e. head always up regardless of the | ||
| device orientation), application needs to do the following: | ||
|
|
||
| #. Setup the application to get orientation change notification | ||
| (by adding ``android:configChanges="orientation|keyboardHidden|screenSize"`` | ||
| in the application manifest file and override the callback ``onConfigurationChanged()``). | ||
| #. Inside the callback, call PJSUA2 API ``VidDevManager::setCaptureOrient()`` | ||
| to set the video device to the correct orientation. | ||
|
|
||
| For sample usage, please refer to pjsua2 sample app. Ticket :pr:`1861` explains | ||
| this feature in detail. | ||
|
|
||
|
|
||
|
|
||
| Installing additional components | ||
| ----------------------------------- | ||
|
|
||
| .. _android_openh264: | ||
|
|
||
| Installing OpenH264 (optional) | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Note that OpenH264 is optional because native H.264 codec is already provided by :ref:`amediacodec`. | ||
|
|
||
| #. Build OpenH264 for Android. See :ref:`openh264` for more information. | ||
| #. Run **configure-android** with specifying OpenH264 directory, e.g.: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| $ ./configure-android --with-openh264=/Users/me/openh264/android | ||
|
|
||
| #. Make sure openh264 is detected: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| ... | ||
| Using OpenH264 prefix... /Users/me/openh264/android | ||
| checking OpenH264 availability... ok | ||
| ... | ||
|
|
||
| .. note:: | ||
|
|
||
| If you use PJSIP before version 2.6, you need to specify external libyuv via | ||
| the configure script param ``--with-libyuv``, check :pr:`1776` for more info. | ||
|
|
||
| #. Copy all library's **.so** files into your Android application's **jniLibs/$ARCH** directory, | ||
| as explained in :ref:`android_copy_3rd_party_libs`. For example: | ||
|
|
||
| .. code-block:: shell | ||
|
|
||
| $ cd pjsip-apps/src/swig/java/android/pjsua2/src/main/jniLibs/arm64-v8a | ||
| $ cp /Users/me/openh264/android/*.so . | ||
|
|
||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.