Android Question Doubt in Manifest Editor

Abílio Magalhães

Member
Licensed User
Longtime User
Hello to all.

I've a doubt that about the Manifest Editor, if it can be edited programmatically, but I'll explain what I want to do.

I've read the Dropbox sync, Libraries and so on, and I've successfully implemented it in my App, and it works properly and uploads the files that I want to DB, so far so good.

In the Manifest Editor I've had to put the key given by Dropbox like this



B4X:
<data android:scheme="db-KEY IN HERE" /> <!-- NEED TO UPDATE -->


so it would work properly with the specific Dropbox account.

Now pops the doubts. Can I change the Manifest key by code?

Like creating an EditText on my program, than a button.
The user inserts the key in the EditText (and the secret off course), then when the button is pressed, the field in Manifest Editor where the key sets changes to the text inputed.

If it can be done that would be awesome, because I can create accounts in DB, then a field in my database where it stores the key and secret, then it changes when the user wants.

I know that the Manifest Editor is read-only, but it can be done?

Thank you all.
 

Abílio Magalhães

Member
Licensed User
Longtime User
HMM.. That was what I thought.

I know that the key is the app key, but I wanted to create those fields, then create an DB account to each costumer , then input the key in the field so the manifest recognizes it and let the user upload backups to the specific DB account (its own).

If I create a field where the user inputs the key and secret strings, then in where
B4X:
manager.Initialize(key, secret, "manager")
the key would be equals to the EditText.txt the manager will read it properly, but the Manifest won't because the key inserted there has to be inserted manually, that's why I made this question.

If it could be done I'd do it so the Manifest changes as far as I wanted to, but I know it's read-only and then when it compiles it cannot be edited.

:(

I'll try to do something else so.

Is there a way to call the Dropbox app installed on the device?
Like this to call the Gmail one:

B4X:
email.SetComponent("com.google.android.gm/.ComposeActivityGmail")

If so I'll try to input the backup in the DB app then the DB uploads the specific file to the user's account.

Best regards.
 
Upvote 0

eps

Expert
Licensed User
Longtime User
You are attempting to use the Manifest File for something that it is not intended. It is used to compile the code, it makes no sense to tailor it for each User as they will need to compile the code in order to use the App..

What are you attempting to achieve?

Could you not store the Dropbox details in a text file and then use this or allow the User to enter / edit their own details?
 
Upvote 0

eps

Expert
Licensed User
Longtime User
As Erel said : The key required for Dropbox Sync is your app key it is not a key specific to the user.
 
Upvote 0

Abílio Magalhães

Member
Licensed User
Longtime User
I'd want to create a field to let the user backup its database to dropbox, but I'd want to set separate Dropbox accounts for each user so each one has its own.

Then the user uploads its backups to dropbox, to the account created by me, but the Manifest only recognizes the key inserted there.
If I create a field where the user inputs the key and the secret that would be great because the app connects so each dropbox accounts, signed by the key and secret strings.

It cannot be done, because the manifest won't recognize the strings, because it cannot be changed, so if I want to do that to each costumer, I'll have to create the accounts, then change the manifest editor and input there the specific key, then compile the program... My point is that I've wanted to do it after the compilation, but now I know that's impossible, that's right.

Know I've poped another question, if anyone knows how to call the Dropbox App installed on the device. I know how to call the Gmail one, but not the DB.

;)

GMAIL:

B4X:
Dim mail As Intent
mail.Initialize("","")
mail.SetComponent("com.google.android.gm/.ComposeActivityGmail")

Dim content As Email
content.Attachments.Add("BLABLABLA")
content.To.Add(txt_Email.Text)
contrent.Subject="Some text"
content.Body="Some text"

mail = content.GetIntent

'open
startactivity(mail)

Like this.

regards.
 
Upvote 0

Abílio Magalhães

Member
Licensed User
Longtime User
Not really..
That I've seen.

What I want to do is open the Dropbox app installed on the device.
(The one you download from the playstore).

In my code up here it opens the Gmail App installed.

I think it will be using the Intents too, but I can't find the path to it.
 
Upvote 0

Abílio Magalhães

Member
Licensed User
Longtime User
Never mind, I figured it out.

B4X:
Dim app As Intent
    Dim pm As PackageManager
    app=pm.GetApplicationIntent("com.dropbox.android")
   
    If app.IsInitialized Then
        StartActivity(app)
    Else
        Msgbox(LastException.Message,"ERROR")
    End If
 
Upvote 0

NJDude

Expert
Licensed User
Longtime User
Never mind, I figured it out.

B4X:
Dim app As Intent
    Dim pm As PackageManager
    app=pm.GetApplicationIntent("com.dropbox.android")
   
    If app.IsInitialized Then
        StartActivity(app)
    Else
        Msgbox(LastException.Message,"ERROR")
    End If
If you don't want to use the Phone library you can do this:
B4X:
Dim i As Intent
i.Initialize("", "")
i.SetComponent("com.dropbox.android/.activity.DropboxBrowser")
StartActivity(i)
 
Upvote 0
Top