Android: one app for multiple uses via parameters in AndroidManifest - delphi

It is possible to register one (Delphi) app for multiple uses, with more than one icon in App Chooser? For instance like this:
register app to open some file types (I know how to do that)
register to open/acces to any file, but App Chooser should show icon different than main app icon, and different text, not the app name - for instance "Base 64 encode/decode file"
same thing, for text files or other documents/images compatible with operation - "Convert to pdf"
All functionality is built in the same app, but operation, and icon in the App Choser, should depend of parameter passed in intent, as EXTRA_TEXT for instance. For instance, if EXTRA_TEXT is "b64enc" the app should auto encode the file on intent EncodedPath, then save base 64 encoded file in app documents folder, notify user "conversion complete", then close itself.
For example, app can use file extension to choose what to do with the file, but this is not enough for functionality I need.
I have seen this answer
Multiple Application Files in one Android app
and it is OK as some kind of guidance, but not really an answer on this question :-)
In Windows the same application can register itself in Win context menu for multiple purposes with different icons and different context menu text, and same program can do different operations on the file, depends on parameter passed to the program.
So, it is possible in Android, maybe via AndroidManifest, or I shoud use different approach? And if I must, is it possible to have multiple activities in Delphi app for Android?
Edit: I have found this blog
https://blog.andreamagni.eu/2019/02/how-to-add-android-app-shortcuts-to-a-fmx-application/
and looks like maybe it is possible by using shortcuts

Related

Can a Mongo Stitch app be renamed in the web UI?

I am trying Mongo Stitch to see if I can use it for some small web apps.
I created a simple application to play with some incoming web hooks and triggers, and called it MyApp. I am now expanding the application, and I have a purpose for it, so I'd like to give it a more meaningful name. However, on the Stitch Applications page, the only feature available in the app context menus is "Delete".
I expect I could do an export and an import using the console command, and editing the text files in-between, and if there is no other option, that is what I will do. However, it seems such an obvious oversight, I wonder if I have just not seen a menu option somewhere.
Currently, you cannot change it. Exporting it, changing the app name (and removing the clientAppId), and importing again should work. Essentially creating a new app.

WKWebView File System Browser

I've been asked to add a file browser to an existing Objective C application that uses a WKWebView to load up a Javascript internal app.
Currently we have the capability of looking at the pictures on device to upload images into the app, but I've now been asked to do the same with more generic file types, specifically PDFs.
What I've read so far is that this is only possible if a file is stored in a specific part of the file system and only if the app knows exactly where the file is to begin with, but what I need is the capability to browse to a certain degree.
What I'd like to know is whether this is possible and if there is a good place to start on that?
Thanks.

How to design a container like iOS app that can grow in functions?

We have a requirement where we need to build an iOS app 'A' that would have menu options for a number of functionalities and these functionalities will grow over time. So, the clients suggested that we do an iOS app 'A' that displays just the menu options and the options when clicked will each launch another iOS app (which implements that functionality) residing on the device. This would be a bad user experience considering the user will have to be moved out of 'A' for each link. At the same time, we cannot build all the features in 'A' since the size of 'A' would get too large.
Is there an elegant design solution for this kind of an application?
Launching a different app for each function seems a bit clunky at first, but on the other hand it does offer the flexibility of adding additional modules without having to rebuild and redistribute your application every time. If the modules are independent enough that a user wouldn't need to constantly switch between them, this might not be a bad solution.
You could use custom URL schemes to launch each module, and use (for example) an XML file to configure which modules are available and the URL scheme to launch each one. That way you could update the XML file remotely (have the application call a web service on startup to check for an updated configuration file). Your configuration file could be as simple as something like this:
<modules>
<module name="Module A" url="moduleA://myModuleA"/>
<module name="Module B" url="moduleB://myModuleB"/>
<module name="Module C" url="moduleC://myModuleC"/>
</modules>
and then the app could provide a button to launch each module. You can add additional tags for any other information you need about each module (e.g. an icon image or whatever).
When you add a new module, update the config file on the server and the app will find it on the next startup. Your app would have to redirect the user to the app store to download and install the new module if it's not already installed on their device.
Of course if your modules need to communicate with each other or share data, it gets more complicated. You can pass parameters between modules in the custom URL scheme, but if they need to share large amounts of data (like a database or something), then you'd need some other way to share that data.
Hope this helps.

Custom file types with iOS Document Interaction Programming

I understand the basic of Document Interaction Programming and UIDocumentInteractionController and I've got it working in my app. However I'm having trouble with specific details of using custom file types. I can't find this addressed in the Apple docs anywhere.
My app uses it's own file types with unique extensions. The files themselves are just plists (xml), but I want the device to treat the files as only openable in my app. Originally I implemented the Document Interaction stuff to treat them as XML while I got it working, but now I want it to treat them as binary files that it needs to hand off to my app.
At the moment, if you have one of my files in an email attachment, iOS first shows the QuickLook (which just spews all the text content of the xml out) before you can choose to Open In. Similarly if one of my files is opened with Safari, Safari just shows the XML and doesn't give you the option to show it in my app at all.
So how do I get iOS to not treat my files as XML? I've changed the "Conforms to UTI" value and "public.mime-type" value in the info.plist, but it seems to have no effect.
Any tips greatly appreciated.
As far as i understand the UIT concept of Apple you cannot just change the file extension to change a potential UIT of the file. If the file contains XML-Data, other apps as well as internal apps might recognize your content and show it internally as XML.
Try to store your Plists with NSPropertyListSerialization NSPropertyListBinaryFormat_v1_0 (then you readble XML)
When you did that without success, why not trying this:
use zlib to compress the XML plists afterwards to a zipped file.
make a "unique" file extensions (<file>.myappname)
this should "hide" other apps and quick view.
Tell me if one of the ways did work for you.

Config file to change values within an app

I'm having a problem meeting a requirement for an Java app I'm developing. My client must be able to deploy the app to multiple BES servers without the need to resign the code (or have any interaction with the developers). Currently the web address of one of their BES servers is hard coded into the app but they require the ability to change this value at will prior to deployment. (it can be assumed they will administrate any BES server the app is deployed from)
I've tried attaching a text file to the project which is read by the app but this is packaged along with the app, meaning it can't be manually edited (as far as I'm aware), I've also tried having a custom property in the JAD file but this needs resigned after any change.
Am I doing any of these approaches wrong or is there a better solution I'm missing?
Also, is it possible to deploy a simple text file to a BlackBerry via the BES to a specific file location? If so I could have my app read this file which would solve the problem?
Thanks,
Implement custom attachment handler in your application.
And send email with an attached xml-config file to BlackBerry device.
User opens the received message and selects the custom menu item provided by attachment handler.
And you can parse this xml config and act accordingly.
An easier way is to use a user defined ItPolicy to provide the configuration information you need.

Resources