Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23229] ANDROID: Support to Photo upload from remote webpage in webview

GitHub Issuen/a
TypeStory
PriorityHigh
StatusClosed
ResolutionDone
Resolution Date2016-04-20T23:55:48.000+0000
Affected Version/sRelease 5.2.2
Fix Version/sn/a
ComponentsAndroid
Labelslook1
ReporterNikunj Kapupara
AssigneeAshraf Abu
Created2016-04-18T10:09:04.000+0000
Updated2018-08-06T17:34:56.000+0000

Description

In one of the my Appcelerator Project there is one functionality like, We are showing a remote webpage in webview and in that webpage there is Photo Upload Browse button. By clicking on that button Option dialog comes that ask to choose photo from Camera or Photo Gallery and we can select the photo. That functionality is works fine in iOS but in android Titanium SDK has not support to choose and upload a photo from remote web page which is loaded on webview. Earlier we are using a modified Titanium SDK. Can you please modified latest Titanium SDK(5.2.X Onwards) that support this feature. Modified SDK (https://www.dropbox.com/s/j2csab3dhy6w3u2/4.1.0.GA_For_Correction_Camera_Web_upload.zip?dl=0) which allow to select photo from gallery or camera and this working fine in iOS and Android so the same change I need for latest version of Titanium SDK (5.2.X Onwards) If you know, what changes we have to do in Titanium SDK to support this feature so can you suggest me in which file of Titanium SDK we need to do changes and what changes we have to write Titanium SDK files ?.

Attachments

FileDateSize
Screenshot_2016-04-18-13-23-41.png2016-04-18T10:07:26.000+0000180670
ti.cloudpush-android-3.3.9.zip2016-04-20T07:34:38.000+00004502215

Comments

  1. Hans Knöchel 2016-04-18

    We need a master PR first since it's the base branch. Backports can make as soon as the master is approved. Since this is a feature, it probably won't go into 5_2_X, but it can be cherry-picked if anyone needs it. If we can review and merge the upcoming master-PR soon, it can go into 5.4.0. Thanks everyone!
  2. Chee Kiat Ng 2016-04-18

    Here's the PR mentioned above. https://github.com/appcelerator/titanium_mobile/pull/7949
  3. Nikunj Kapupara 2016-04-19

    I have made the master pull request. Can you please view it and let me know if I did it correct/wrong. Android Webview Photo upload #7949 #7950 https://github.com/appcelerator/titanium_mobile/pull/7950
  4. Nikunj Kapupara 2016-04-19

    Can you please make the changes in Titanium in any of 5.2.X series of SDK and give me because I can't wait for next upcoming Ti.SDK release, last time I got modified SDK from you with this feature. Modified SDK (https://www.dropbox.com/s/j2csab3dhy6w3u2/4.1.0.GA_For_Correction_Camera_Web_upload.zip?dl=0 Thanks and Regards,
  5. Nikunj Kapupara 2016-04-19

    Can you modified any current Titanium 5.2.X version of SDK and send me back, as earlier we got the same because I can't wait for next release when it will available and our application is LIVE already. Moreover, I also have to give the support of Android 6.0 and Android 6.0 support can't be possible in 4.1.0GA SDK because it takes TargetSDK 22 and we have uploaded Target SDK 23 on store. In short I need any of current Titanium 5.2.X version of SDK which allow me to select photo from webview in android as I have mentioned above. (attachment) It's very urgent so please co-operate me.
  6. Ashraf Abu 2016-04-19

    [~nkapupara@tacme.com] We would be glad to help and assist. The PR https://github.com/appcelerator/titanium_mobile/pull/7949 contains a lot of changes which is not what is needed for this issue. (Hans mentioned it in the PR. Would you have the exact changes (or a previous JIRA ticket so that we can check) that was done for the customised 4.1.0.GA?
  7. Ashraf Abu 2016-04-19

    I believe this ticket was what was done previously: TIMOB-19463
  8. Ashraf Abu 2016-04-19

    Cherry-picked the changes in TIMOB-19463 into 5_2_X branch. Branch is located here https://github.com/ashcoding/titanium_mobile/tree/5_2_X_TIMOB-23229 (Ready)
  9. Ashraf Abu 2016-04-19

    Branch mentioned above contains the changes needed and is in the 5_2_X branch that can be compiled to create a customised SDK and needs to be tested to check that the functionality is available. Updated: I tested with test case provided in TIMOB-19463. Working.
  10. Ashraf Abu 2016-04-19

    [~nkapupara@tacme.com] You should be able to use this branch https://github.com/ashcoding/titanium_mobile/tree/5_2_X_TIMOB-23229 and compile it to create a custom SDK with the function you need.
  11. Nikunj Kapupara 2016-04-19

    In which SDK you have checked that the Android webview photo upload can work. means I can open the Photo Gallery/ Camera by clicking on Browse button on the remote webpage which is loaded on webview in ANDROID
  12. Nikunj Kapupara 2016-04-19

    On the Comment of msamah Ashraf Abu added a comment - 1 hour ago *Would you have the exact changes (or a previous JIRA ticket so that we can check) that was done for the customised 4.1.0.GA?* -> Yes, That changes has been done previously but I have not previous JIRA ticket records. I am trying to check whether previous one is this or not: TIMOB-19463 but I am getting Permission violation web page so I can't say about this. Would you have the exact changes (or a previous JIRA ticket so that we can check) that was done for the customised 4.1.0.GA? The changes done by your team and I don't know what the changes they did in this Modified SDK (https://www.dropbox.com/s/j2csab3dhy6w3u2/4.1.0.GA_For_Correction_Camera_Web_upload.zip?dl=0 But support this feature I need same changes to be done in any of current 5_2_X series of Titanium SDK and send me that SDK so I can work with this feature in android.
  13. Nikunj Kapupara 2016-04-19

    Our team or I don't know which the changes needs to do for this feature that's why I am requesting to you/team so that I can use this feature in any of our Titanium 5.2.X version of SDK. Thanks and Regards,
  14. Ashraf Abu 2016-04-19

    [~nkapupara@tacme.com] It's all done. The branch is here: https://github.com/ashcoding/titanium_mobile/tree/5_2_X_TIMOB-23229 and you can compile it to use it.
  15. Nikunj Kapupara 2016-04-19

    It's Ok.. very nice to hear from you.. Let me check this feature first in Android: *Photo upload from remote webpage in webview*
  16. Nikunj Kapupara 2016-04-19

    You mean to say, I can put it in my Titanium SDK directory and use this SDK and run the project in android to check?? M I right? Application Support/Titanium/mobilesdk/osx/titanium_mobile-5_2_X_TIMOB-23229
  17. Ashraf Abu 2016-04-19

    You'll need to compile it before using it.
  18. Nikunj Kapupara 2016-04-19

    Can you please give me compiled Titanium 5.2.X SDK so we can check and test for this feature because we are running out of time and we knew that there are some issue comes in picture after compile it? Because some of the Softwares we have not installed on our system Python Oracle JDK iOS SDK (only on Mac OS X systems) Android SDK (requires Android 4.2.2, API Level 17, and Google APIs 14 or later) Node.js (required for building SDK 3.0 and later) The following additional software is required for building the Titanium SDK: Python setuptools, and the pyyaml and Pygments libraries Git Android NDK SCons Apache Ant (for Android) Eclipse and ADT (for Android) Gperf Visual C++ 2010 Express (for Windows systems) Many many Thanks in advance
  19. Shuo Liang 2016-04-19

    [~nkapupara@tacme.com], Please check below dropbox link about this custom SDK for you and verify if it is working for you. https://www.dropbox.com/s/htn926i0uf7zf2i/mobilesdk-TACME-osx.zip?dl=0
  20. Nikunj Kapupara 2016-04-19

    Ok.. Let me check if this working as per my requirement. Actially, can you tell me which SDK version you have modified. I am asking because I also need to give the support for Android 6.0.
  21. Shuo Liang 2016-04-19

    I compiled this SDK based on 5.2.2.
  22. Nikunj Kapupara 2016-04-19

    Ohh. Great Latest one!!!. Can I expect this feature in next upcoming Titanium SDK update????
  23. Nikunj Kapupara 2016-04-19

    When I compile & Run my appcelerator project using this modified 5.2.2 SDK with Ti.Cloudpush (3.4.1) module I can't run run app I am getting Java compiling exception. Failed to run dexer: [ERROR] : [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ReserveIntents; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/SearchIntents; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEvent; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEventsRequest; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEventsResponse; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GoogleAuthException; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GoogleAuthUtil; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GooglePlayServicesAvailabilityException; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/UserRecoverableAuthException; [ERROR] : [ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] : java.lang.RuntimeException: Translation has been interrupted [ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608) [ERROR] : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311) [ERROR] : at com.android.dx.command.dexer.Main.run(Main.java:277) [ERROR] : at com.android.dx.command.dexer.Main.main(Main.java:245) [ERROR] : at com.android.dx.command.Main.main(Main.java:106) [ERROR] : Caused by: java.lang.InterruptedException: Too many errors [ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600) [ERROR] : ... 4 more I have find out on Google about this error many of says Ti.Cloudpush module is not working properly. There is some bugs in that module. Mine problem is If I use Ti.cloudpush module 3.3.8 the app is working fine, but not in Android 6 (Marsh mellow) at that time I am getting this error on app startup: ERRORORORRORR: linker: /data/app/uae.gov.uaq-2/lib/arm/libti.cloudpush.so: has text relocations [ERROR] : TiApplication: (KrollRuntimeThread) [39,128] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/uae.gov.uaq-2/lib/arm/libti.cloudpush.so: has text relocations; Titanium 5.2.3,2016/04/19 18:15,0f120f0 [ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/uae.gov.uaq-2/lib/arm/libti.cloudpush.so: has text relocations [ERROR] : TiApplication: at java.lang.Runtime.loadLibrary(Runtime.java:372) [ERROR] : TiApplication: at java.lang.System.loadLibrary(System.java:1076) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:132) [ERROR] : TiApplication: at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:99) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:205) [ERROR] : TiApplication: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:114) If I use the Ti.cloupush module 3.4.1 or 3.4.0 then I can't even compile the project and I am getting those mentioned java compile exception and execution is stopped. Tell me what to do now. Can you please give me the bug free ticloudpush module which is can run with this 5.2.2 modified SDK Thanks and Regards.
  24. Ashraf Abu 2016-04-20

    Purely running with Only Ti.Cloudpush 3.4.1 is not causing any issues alone. What other modules are you including into your project? It seems the errors are related to google-play-services.jar dependencies. The google play jar could be removed by going to the other modules that you have in your project in "modules">"android">"module-name">"version">"lib">"google-play-services.jar". Removing this will stop that error but would require you to be sure that you would not need that module to access the google-play-services. Alternatively, that other module needs updating with the proper google-play jar. In order to help, we would need to know what other modules are being included.
  25. Nikunj Kapupara 2016-04-20

    The other modules which I am using in my project is: *iOS & Android (Both):* com.appcelerator.apm ti.map facebook ti.cloud *Android: ti.cloudpush* iOS: path.animator +I don't think the problem with another module as you are talking google play jar file because if you check the log it clearly mentioned the error related to cloudpush+ inker: /data/app/uae.gov.uaq-2/{color:#d04437}lib/arm/libti.cloudpush.{color}so: has text relocations [ERROR] : TiApplication: (KrollRuntimeThread) [39,128] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/uae.gov.uaq-2/lib/arm/libti.cloudpush.so: has text relocations; Titanium 5.2.3,2016/04/19 18:15,0f120f0 [ERROR] : TiApplication: java.lang.UnsatisfiedLinkError: dlopen f{color:#d04437}ailed: /data/app/uae.gov.uaq-2/lib/arm/libti.cloudpush.so: has text relocations{color}
  26. Ashraf Abu 2016-04-20

    That is using Ti.Cloudpush 3.3.8 correct?
  27. Nikunj Kapupara 2016-04-20

    Yes, Ti.cloudpush 3.3.8 for Android https://www.dropbox.com/s/4fgcanaa0b7btxp/Screen%20Shot%202016-04-20%20at%2011.10.28%20AM.png?dl=0
  28. Ashraf Abu 2016-04-20

    [^ti.cloudpush-android-3.3.9.zip] Attached here is 3.3.9. This should solve your issue. Please use this. Thank you. [~nkapupara@tacme.com]
  29. Ashraf Abu 2016-04-20

    Also please note, on Android 6.0, if you are going to use the choose file option, you need to add in your code to request camera permission if you want to allow the user to be able to take a photo directly.
  30. Nikunj Kapupara 2016-04-20

    Any way I have to thank you for your quick and easy support for this modified SDK... *_+Thank you so so so much for your help and support.+_*
  31. Ashraf Abu 2016-04-20

    Did the cloudpush version 3.3.9 work for you?
  32. Nikunj Kapupara 2016-04-20

    No sorry, *It's not worked. When I used 3.3.9 Ti.cloudpush module I got the google play jar conflicting error.* Conflicting jar files detected: [ERROR] : [ERROR] : The following modules have different "google-play-services.jar" files [ERROR] : ti.map (version 2.3.1) (hash=a9b753b4c63719e24d0022e341c57b2e) [ERROR] : ti.cloudpush (version 3.3.9) (hash=93f8dd307017098f89f81d72439473ae) [ERROR] : [ERROR] : You can either select a version of these modules where the conflicting jar file is the same or you [ERROR] : can try copying the jar file from one module's "lib" folder to the other module's "lib" folder. *Then what I did I changed the map module version 2.3.1 to 2.3.3 and I got the same java compilation error which I faced earlier.* Failed to run dexer: [ERROR] : [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ItemListIntents; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/NoteIntents; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/ReserveIntents; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/actions/SearchIntents; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEvent; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEventsRequest; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/AccountChangeEventsResponse; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GoogleAuthException; [ERROR] : Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/auth/GoogleAuthUtil; [ERROR] : [ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] : java.lang.RuntimeException: Translation has been interrupted [ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608) [ERROR] : at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311) [ERROR] : at com.android.dx.command.dexer.Main.run(Main.java:277) [ERROR] : at com.android.dx.command.dexer.Main.main(Main.java:245) [ERROR] : at com.android.dx.command.Main.main(Main.java:106) [ERROR] : Caused by: java.lang.InterruptedException: Too many errors [ERROR] : at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600) [ERROR] : ... 4 more
  33. Ashraf Abu 2016-04-20

    As mentioned in the error log: [ERROR] : [ERROR] : The following modules have different "google-play-services.jar" files [ERROR] : ti.map (version 2.3.1) (hash=a9b753b4c63719e24d0022e341c57b2e) [ERROR] : ti.cloudpush (version 3.3.9) (hash=93f8dd307017098f89f81d72439473ae) [ERROR] : [ERROR] : You can either select a version of these modules where the conflicting jar file is the same or you [ERROR] : can try copying the jar file from one module's "lib" folder to the other module's "lib" folder. What you should do is you should use ti.map version 2.3.1 and ti.cloudpush 3.3.9. And after in your project folder, you should try this:- Project>modules>android>ti.cloudpush>3.3.9>lib>google-play-services.jar Copy this file. And put it in:- Project>modules>android>ti.map>2.3.1>lib> This will allow both modules to use the same "google-play-services.jar".
  34. Nikunj Kapupara 2016-04-20

    Yes man, That trick is worked.. Thank you so much..
  35. Nikunj Kapupara 2016-04-20

    What to do about map in Android 6 when I pressed back or close my window app is crashed. I figured this exception. TiApplication: (main) [7554,228221] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {uae.gov.uaq/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.clear()' on a null object reference; Titanium 5.2.3,2016/04/19 18:15,0f120f0 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to destroy activity {uae.gov.uaq/org.appcelerator.titanium.TiTranslucentActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.clear()' on a null object reference [ERROR] : TiApplication: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3831) [ERROR] : TiApplication: at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3849) [ERROR] : TiApplication: at android.app.ActivityThread.-wrap5(ActivityThread.java) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.google.android.gms.maps.GoogleMap.clear()' on a null object reference [ERROR] : TiApplication: at ti.map.TiUIMapView.release(TiUIMapView.java:900) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:539) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:536) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:536) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:536) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:536) [ERROR] : TiApplication: at org.appcelerator.titanium.proxy.TiWindowProxy.closeFromActivity(TiWindowProxy.java:189) [ERROR] : TiApplication: at org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1506) [ERROR] : TiApplication: at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:29) [ERROR] : TiApplication: at android.app.Activity.performDestroy(Activity.java:6422) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1142) [ERROR] : TiApplication: at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3818) [ERROR] : TiApplication: ... 9 more [INFO] : Process: Sending signal. PID: 30860 SIG: 9
  36. Ashraf Abu 2016-04-20

    This is a bug and it's only fixed in Ti.Map https://github.com/appcelerator-modules/ti.map/releases/tag/android-2.3.10 If you use this, you need to change your Ti.Cloudpush to version 3.4.1 to ensure the google play dependencies are correct.
  37. Nikunj Kapupara 2016-04-20

    Ok.. let me try..:)
  38. Nikunj Kapupara 2016-04-20

    Yes, Great Work you have done for me and my Company.. It's Done and worked. *_+{color:#205081}THANK YOU VERY MUCH FOR YOUR ALL SUPPORT AND HELP.{color}+_*
  39. Ashraf Abu 2016-04-20

    Resolving ticket.
  40. Ashraf Abu 2016-04-20

    [~nkapupara@tacme.com] Welcome. Please take note for future updates for that app, the required function that you need is not in the GA SDK. It's only provided in the custom SDK.
  41. Nikunj Kapupara 2016-04-21

    No problem for resolving ticket, anyway my bug is fixed and working fine. But why you are not including this feature (ANDROID: Support to Photo upload from remote webpage in webview) in upcoming Titanium SDK release. Many of developer can user this feature. Ok... Thanks for your help and support.
  42. nicolomonili 2016-11-11

    There is no way yet to upload a file via Webview on Android ?
  43. Eric Merriman 2018-08-06

    Closed as completed. If this is in error, please reopen.

JSON Source