I want to open a browser with an .apk argument from 
Display.getInstance().execute([default browser])
I don't have a clue how to execute the default browser, what text do I 
substitute "[default browser]" with?

Can I open the default browser in my app?
If so can I pass the browser a local .apk file for it to open?
Will this work?

Regards;


On Monday, July 27, 2020 at 10:43:23 PM UTC-4, Shai Almog wrote:
>
> Execute opens a URI using the platform native system. We didn't use it for 
> a locally downloaded file only for a web link so in this case it literally 
> opens the browser and lets it deal with the permissions and related 
> complexities.
> If you want to do the download yourself this is something we didn't do in 
> Codename One Build. I'm guessing the native Android code you have should 
> work within a native interface. You might need to add some permissions and 
> declare them in the XML using the xpermissions build hint.
>
> On Monday, July 27, 2020 at 3:57:20 PM UTC+3 [email protected] 
> wrote:
>
>> Ok, I would like to focus on Android build only.
>>
>> In another Post (titled lunch browser) it was suggested to use 
>> Display.execute() to open native browser.
>>
>> Can you please complete the code to point to and execute the native 
>> browser with argument to open .apk?
>> Display.getInstance().execute(????); where ???? is native browser and 1 
>> argument i assume would be a URI
>> Please fill in the ???? 
>>
>> Regards
>>
>> On Sunday, July 26, 2020 at 10:15:11 PM UTC-4, Shai Almog wrote:
>>>
>>> It's a bit more complex than that. In iOS you can't physically install 
>>> apps without a certificate. You have two options here:
>>>
>>> - Development certificate - works on 100 devices which you have to add 
>>> personally to a provisioning profile. Or on 1000 devices via itunes
>>> - Enterprise certificate - works on devices within your organization. 
>>> This means the device needs to be a part of your org. If it belongs to a 
>>> different org this won't work. 
>>> This is something some developers "abused" to create 3rd party appstores 
>>> which Apple shut down by revoking the certificate for ToS violation.
>>>
>>> We don't have any such classes for the public download directory. 
>>> Codename One build just uses execute(URL) and launches your native web 
>>> browser on every OS. We don't download any file.
>>>
>>> FYI AFAIK you are allowed to link to itunes/play listings and if you 
>>> open the browser to the listing and let the user install the app through 
>>> there that's 100% "legal" and doesn't require any complexity. This will let 
>>> you install dependencies easily on all OSs. 
>>> On Sunday, July 26, 2020 at 2:26:34 PM UTC+3 [email protected] 
>>> wrote:
>>>
>>>> Agreed regarding "explicitly ennumerated in the provisioning of the 
>>>> app" I do this. These apps will not be published VIA Apple for our current 
>>>> business model.
>>>>
>>>> Please advise the classes needed to save a file in the android public 
>>>> downloads directory.
>>>>
>>>> Regards.
>>>>
>>>> On Saturday, July 25, 2020 at 10:10:27 PM UTC-4, Shai Almog wrote:
>>>>>
>>>>> We literally use CN.execute(url_of_app). Where the URL is an HTTP URL 
>>>>> that contains the application. 
>>>>> No magic, no native code. 
>>>>>
>>>>> The one thing you might have gotten wrong is the HTTP hosting. You 
>>>>> need to make sure your server is HTTPS and that it has the right mime 
>>>>> types 
>>>>> for the links.
>>>>>
>>>>> But again, you'll only be able to do this on Android. On iOS you can't 
>>>>> even distribute an app without going through the store.
>>>>>
>>>>> On Saturday, July 25, 2020 at 3:21:42 PM UTC+3 
>>>>> [email protected] wrote:
>>>>>
>>>>>> Using codenameone build app, I can download the .apk file to the 
>>>>>> public downloads directory.
>>>>>> Then using file manager can open the downloads directory, tap the 
>>>>>> .apk file and install it.
>>>>>>
>>>>>> Please see attached pic "Screenshot_20200725-081618_File Manager.jpg"
>>>>>>
>>>>>> I want to replicate this.
>>>>>>
>>>>>> Please advise
>>>>>>
>>>>>> Regards.
>>>>>>
>>>>>> On Saturday, July 25, 2020 at 8:03:44 AM UTC-4, Mark Bolduc wrote:
>>>>>>>
>>>>>>> Thanks, perhaps I can make this request simpler. (I don't have any 
>>>>>>> near future requirements of publishing my apps with google or apple)
>>>>>>> So with all due respect to Apple, I am not interested in what apple 
>>>>>>> will accept.
>>>>>>>
>>>>>>> I have it stuck in my head that an .apk & .ipa file is an installer 
>>>>>>> and executing it (from what ever means is needed) will be verbose and 
>>>>>>> open 
>>>>>>> up dialogs to ask user for needed permissions to access photos, caners, 
>>>>>>> audio etc.
>>>>>>>
>>>>>>> I believe if I can save an .apk (Android) file in the (android 
>>>>>>> native method: "ExternalStoragePublicDirectory(Environment.
>>>>>>> DIRECTORY_DOWNLOADS)"), I can then open a browser pointed to the 
>>>>>>> downloads directory and execute the installer for that app. This should 
>>>>>>> work for .ipa & .apk files.
>>>>>>>
>>>>>>> Or just dialog the user with instructions.
>>>>>>>
>>>>>>> So in codenameone, how do I access the public downloads directory for 
>>>>>>> read & write?
>>>>>>> My App already downloads the .apk & .iap files and saves it in the 
>>>>>>> "FileSystemStorage.getInstance().getAppHomePath() + 
>>>>>>> "A3-TECH/A3-TechAppDownloads/"
>>>>>>> So I don't see how to access the public downloads directory.
>>>>>>>
>>>>>>> Best Regards.
>>>>>>>
>>>>>>>
>>>>>>> On Saturday, July 25, 2020 at 1:42:07 AM UTC-4, Shai Almog wrote:
>>>>>>>>
>>>>>>>> You can't do that on iOS. Codename One build which just uses a web 
>>>>>>>> download URL was rejected by appstore review so iOS won't let you do 
>>>>>>>> that 
>>>>>>>> at all.
>>>>>>>> On Android you can do that but it would require a lot of 
>>>>>>>> permissions you honestly don't want to ask for. You're better off 
>>>>>>>> letting 
>>>>>>>> the default app walk the user through those things.
>>>>>>>>
>>>>>>>> On Friday, July 24, 2020 at 4:45:31 PM UTC+3 
>>>>>>>> [email protected] wrote:
>>>>>>>>
>>>>>>>>> Alternatively I found this for Android:
>>>>>>>>>
>>>>>>>>> https://stackoverflow.com/questions/35799567/activity-not-found-using-codename-one-native-code-for-android/35809854#35809854
>>>>>>>>>
>>>>>>>>> public String getDownloadPath() {
>>>>>>>>>     return 
>>>>>>>>> Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath()
>>>>>>>>>  + File.separator + "myfolder";}
>>>>>>>>>
>>>>>>>>> How do I programmatically access (for read & write) the downloads 
>>>>>>>>> directory?
>>>>>>>>>
>>>>>>>>> On Friday, July 24, 2020 at 9:08:02 AM UTC-4, Mark Bolduc wrote:
>>>>>>>>>>
>>>>>>>>>> There has to be a way to trigger an install from the .apk and 
>>>>>>>>>> .ipa files within codenameone.
>>>>>>>>>>
>>>>>>>>>> Using Display.getInstance().execute(???) what process or browser 
>>>>>>>>>> or app can I execute and have it point to the .apk or .ipa file?
>>>>>>>>>>
>>>>>>>>>> The devices download the app and store them in the downloads 
>>>>>>>>>> directory, If I browse that directory I can tap the .apk or .iap 
>>>>>>>>>> file and 
>>>>>>>>>> it will install.
>>>>>>>>>>
>>>>>>>>>> I want to do this programmatically.
>>>>>>>>>>
>>>>>>>>>> How can my app save a file on the devices downloads directory?
>>>>>>>>>>
>>>>>>>>>> Regards.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Friday, July 24, 2020 at 12:59:57 AM UTC-4, Shai Almog wrote:
>>>>>>>>>>>
>>>>>>>>>>> As I said we don't download. We call the URL on the web and the 
>>>>>>>>>>> native download sequence performs the actual download process. The 
>>>>>>>>>>> execute 
>>>>>>>>>>> method accepts an https URL in our servers. 
>>>>>>>>>>>
>>>>>>>>>>> Look at the result of our iOS builds in the browser and inspect 
>>>>>>>>>>> the code. It's an HTML page that points at an XML file that's the 
>>>>>>>>>>> manifest.
>>>>>>>>>>>
>>>>>>>>>>> On Thursday, July 23, 2020 at 3:09:37 PM UTC+3 
>>>>>>>>>>> [email protected] wrote:
>>>>>>>>>>>
>>>>>>>>>>>> You mentioned pointing the execute process to a manifest, how 
>>>>>>>>>>>> does this work?
>>>>>>>>>>>>
>>>>>>>>>>>> Curious, when an .apk file exists in the devices download 
>>>>>>>>>>>> directory, from a file browser, we can click on it and it installs.
>>>>>>>>>>>>
>>>>>>>>>>>> On Thursday, July 23, 2020 at 7:06:15 AM UTC-4, Mark Bolduc 
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Thanks, I have downloaded the .apk file to the mobile device 
>>>>>>>>>>>>> and did call:
>>>>>>>>>>>>>
>>>>>>>>>>>>> Display.getInstance().execute(ApplicationBinariesDownloadPath 
>>>>>>>>>>>>> + fileName, e -> {
>>>>>>>>>>>>>                 System.out.println("saveAndInstallA3MobileApp 
>>>>>>>>>>>>> Complete");
>>>>>>>>>>>>>             });
>>>>>>>>>>>>>
>>>>>>>>>>>>> Can you provide the code syntax to install the .apk or .ipa 
>>>>>>>>>>>>> file that is stored on the mobile device?
>>>>>>>>>>>>>
>>>>>>>>>>>>> BTW: I have no intention of publishing my apps at this stage.
>>>>>>>>>>>>>
>>>>>>>>>>>>> Also, Google made life a lot more complex by requiring a 
>>>>>>>>>>>>> privacy policy be hosted if you access things like camera etc.
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wednesday, July 22, 2020 at 10:53:59 PM UTC-4, Shai Almog 
>>>>>>>>>>>>> wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> We don't download the files. We launch an external download 
>>>>>>>>>>>>>> process using execute(url). We also don't point at the IPA but 
>>>>>>>>>>>>>> rather at a 
>>>>>>>>>>>>>> manifest.
>>>>>>>>>>>>>> Regardless Apple won't approve your app if you do that. Which 
>>>>>>>>>>>>>> is why Codename One Build only works as a web app for iOS which 
>>>>>>>>>>>>>> IMO is 
>>>>>>>>>>>>>> pretty stupid.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> On Wednesday, July 22, 2020 at 8:27:27 PM UTC+3 
>>>>>>>>>>>>>> [email protected] wrote:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>> It sound like you've stored them on the downloads directory 
>>>>>>>>>>>>>>> of your PC.  You need to download them
>>>>>>>>>>>>>>> directly onto your mobile devices, which ought to trigger 
>>>>>>>>>>>>>>> the installation.
>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/da6caadb-731a-432f-9fa3-d835b1224436o%40googlegroups.com.

Reply via email to