Upload images, videos and sounds with third-party

We realize that on Android devices, when uploading images, videos and sounds with third-party modules,  not work fine.

We have been investigating, and it seems that when a third module integrates and shown by WebView in Android, by default, is not allowed.

To solve this, we found a set of instructions that fix this, and after adding the code, if it allows you to upload images, media ...

If someone wants to contribute something more concepts or ideas, Or correct some of the code that I have put down, are welcome. thanks

 

 

--------------------------

Code -->In WebPageActivity.java file, add:

1- 

import android.webkit.ValueCallback;

2-Inside the function "publicclass WebPageActivity extends ActivityBase" Add:

       

private ValueCallback<Uri> mUploadMessage;

privatefinalstaticintFILECHOOSER_RESULTCODE = 1;


         @Override

         protected void onActivityResult(int requestCode, int resultCode, Intent intent) {

         if (requestCode == FILECHOOSER_RESULTCODE) {

         if (null == mUploadMessage)

         return;

         Uri result = intent == null || resultCode != RESULT_OK ? null: intent.getData();

         mUploadMessage.onReceiveValue(result);

         mUploadMessage = null;

            }

        }

 

2.1. Inside "publicvoid onCreate(Bundle savedInstanceState)", Add:


        m_viewWeb = new WebView(this);

 

       public void openFileChooser(ValueCallback<Uri> uploadMsg) {

 

       mUploadMessage = uploadMsg;

       Intent i = new Intent(Intent.ACTION_GET_CONTENT);

       i.addCategory(Intent.CATEGORY_OPENABLE);

       i.setType("*/*");

 

       WebPageActivity.this.startActivityForResult(

       Intent.createChooser(i, "File Chooser"),

       FILECHOOSER_RESULTCODE);

 

       }

 

// For Android 3.0+

      public void openFileChooser(ValueCallback uploadMsg,String acceptType) {

      mUploadMessage = uploadMsg;

      Intent i = new Intent(Intent.ACTION_GET_CONTENT);

      i.addCategory(Intent.CATEGORY_OPENABLE);

      i.setType("*/*");

 

      WebPageActivity.this.startActivityForResult(

      Intent.createChooser(i, "File Browser"),

      FILECHOOSER_RESULTCODE);

     }

 

// For Android 4.1

     public void openFileChooser(ValueCallback<Uri> uploadMsg,String acceptType, String capture) {

     mUploadMessage = uploadMsg;

     Intent i = new Intent(Intent.ACTION_GET_CONTENT);

     i.addCategory(Intent.CATEGORY_OPENABLE);

     i.setType("*/*");

     WebPageActivity.this.startActivityForResult(

    Intent.createChooser(i, "File Chooser"),

    WebPageActivity.FILECHOOSER_RESULTCODE);

    }

 

 -----------------------


Quote · 2 Jan 2014

Great idea, hope someone can help.

Everyday is a new beginning.
Quote · 2 Jan 2014

Thank you.

Actually there is already similar ticket for the upcoming version:

http://www.boonex.com/trac/dolphin/ticket/3269

But we will consider your suggestion as well.

Rules → http://www.boonex.com/terms
Quote · 4 Jan 2014

 

Thank you.

Actually there is already similar ticket for the upcoming version:

http://www.boonex.com/trac/dolphin/ticket/3269

But we will consider your suggestion as well.

 

Thanks Alex. I tried the way "<a href="bxphotoupload:my vocation">Upload photo</a>"; But, Upload photo HTML forms, but for example, if I create a new "event" or anything else, I see no way to assign the ID of that element to the way you say.

 

 

Our approach involves altering the native code, the problem is that many people can not modify this code (because not have license, or works with your app (Boonex directly), but this code  works well.

The option that not modify the native code it's interest to us. Do you know to Assign an ID of some element created with "<a href="bxphotoupload:my vocation">Upload photo</a>"?

Quote · 4 Jan 2014

I can't check it now, but I've made a note in the ticket and will investigate it when we will work on next version of mobile apps.

Our approach involves altering the native code, the problem is that many people can not modify this code (because not have license, or works with your app (Boonex directly), but this code  works well.
The option that not modify the native code it's interest to us. Do you know to Assign an ID of some element created with "Upload photo"?

 

Rules → http://www.boonex.com/terms
Quote · 11 Jan 2014

Hi Alex when would i have to wait for this code to be applied

 

Code -->In WebPageActivity.java file, add:

1- 

import android.webkit.ValueCallback;

2-Inside the function "publicclass WebPageActivity extends ActivityBase" Add:

       

private ValueCallback<Uri> mUploadMessage;

privatefinalstaticintFILECHOOSER_RESULTCODE = 1;


         @Override

         protected void onActivityResult(int requestCode, int resultCode, Intent intent) {

         if (requestCode == FILECHOOSER_RESULTCODE) {

         if (null == mUploadMessage)

         return;

         Uri result = intent == null || resultCode != RESULT_OK ? null: intent.getData();

         mUploadMessage.onReceiveValue(result);

         mUploadMessage = null;

            }

        }

 

2.1. Inside "publicvoid onCreate(Bundle savedInstanceState)", Add:


        m_viewWeb = new WebView(this);

 

       public void openFileChooser(ValueCallback<Uri> uploadMsg) {

 

       mUploadMessage = uploadMsg;

       Intent i = new Intent(Intent.ACTION_GET_CONTENT);

       i.addCategory(Intent.CATEGORY_OPENABLE);

       i.setType("*/*");

 

       WebPageActivity.this.startActivityForResult(

       Intent.createChooser(i, "File Chooser"),

       FILECHOOSER_RESULTCODE);

 

       }

 

// For Android 3.0+

      public void openFileChooser(ValueCallback uploadMsg,String acceptType) {

      mUploadMessage = uploadMsg;

      Intent i = new Intent(Intent.ACTION_GET_CONTENT);

      i.addCategory(Intent.CATEGORY_OPENABLE);

      i.setType("*/*");

 

      WebPageActivity.this.startActivityForResult(

      Intent.createChooser(i, "File Browser"),

      FILECHOOSER_RESULTCODE);

     }

 

// For Android 4.1

     public void openFileChooser(ValueCallback<Uri> uploadMsg,String acceptType, String capture) {

     mUploadMessage = uploadMsg;

     Intent i = new Intent(Intent.ACTION_GET_CONTENT);

     i.addCategory(Intent.CATEGORY_OPENABLE);

     i.setType("*/*");

     WebPageActivity.this.startActivityForResult(

    Intent.createChooser(i, "File Chooser"),

    WebPageActivity.FILECHOOSER_RESULTCODE);

    }

Everyday is a new beginning.
Quote · 28 Apr 2014

We will consider this feature when we will work on the next mobile app version, however you can already use this code if you have mobile license - so you can have access to the source of mobile apps.

Hi Alex when would i have to wait for this code to be applied

 

Rules → http://www.boonex.com/terms
Quote · 28 Apr 2014

Why do i have to wait? Also a long time ago i think it was like back in 2010 i purchased the license for everything and back then the agent i dealt with was ummmm that girl who i think is Asian. She told me that yes i have a license and the company in which i chose at the time was HIT or something close, they went down cause they lied to a lot of clients. I am stuck now cause there is no way to prove my purchase.

Everyday is a new beginning.
Quote · 28 Apr 2014

Why won't i get a reply i have proof i purchased for my mobile rebrand, why is it so hard to get answers here, when you have the proof in your hands?

Everyday is a new beginning.
Quote · 1 May 2014

If you are saying that you have mobile license, then you can make any changes in it - just apply highlighted changes, but please note that this changes aren't tested by boonex yet.

If you have problems with rebranding - we can't do anything with it, because rebranding is done by 3rd-party - I would suggest to refund your money you paid for rebranding and leave negative review, it will help others, also after several reports we can suspend the member permanently.

Rules → http://www.boonex.com/terms
Quote · 5 May 2014

I am still waiting on a reply regarding my license for the mobile in which i paid for yrs ago and never received a license for rebranding. I even sent a message to Andrew and no reply , why am i being ignored?

Everyday is a new beginning.
Quote · 28 Jul 2014

It was a company called HIT and they closed and went out of business due to fraud.

Everyday is a new beginning.
Quote · 30 Jul 2014

Are these issues are only with android or ios as well?? 

and are these issues fixed in 7.1 version??

Quote · 19 Aug 2015
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.