x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Run Java(Android) code from C++ using JNI

Hey guys,

I'm new to C++ programming but I can do Java and Android pretty decently. I know the bare basics of CPP but nothing more.

I knew you could write android in native code too but I never really got to learn it.

I've been using UE4 for some time now and trying to make my first game for android but blueprints lack some android functionalities that I would like to add in my game like -

  1. Orientation control.

  2. Sending intents

  3. Accessing android content providers.

So, I was looking through forums and answerhub to see useful stuff. I learnt about AndroidJNI but am very unclear on how to use it.

Some questions -

  1. Do I need UE4 Launcher or UE4 Source to make custom Java (Android) functions to be called from C++?

  2. Do I need to modify the GameActivity.java file in my Project folder or the Engine folder?

  3. How do I make a custom BP Node that calls the function created?

Please I would be really grateful if someone can provide a step by step guide for implementing this. By looking at the forums and answerhub it seems a pretty common thing.

Any simple example Like making an android Toast BP Function that says "Hello World". or makes a Toast with a String input provided.

It would be really amazing Thankyou.

Product Version: UE 4.13
Tags:
more ▼

asked Sep 08 '16 at 08:40 AM in C++ Programming

avatar image

SHOBBIT
650 13 13 28

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I was able to do it. By the help of MobileUtils Plugin by GameDNA Studios.

more ▼

answered Sep 09 '16 at 05:27 PM

avatar image

SHOBBIT
650 13 13 28

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question