Android Question Include variable or text file in APK

Carthalion

Member
Licensed User
Longtime User
The easiest way to ask my question is to explain what I am trying to do. I want to offer custom APK files to my existing clients who are using my .Net software. Their site is in a folder in my server. I want to include a variable in the custom APK that will point the user at their folder. Then they can download text files there that store things. (Their contact information, etc.)

Everything works except I do not know how to include the variable that holds the folder name. A global constant would be great, but maybe not an option. A text file with the folder name would work because each activity could read the file in Create.

Does this seem feasible? If so, what do you suggest for the best approach?

Thanks,

Carthalion
 

KMatle

Expert
Licensed User
Longtime User
Security is a must have here. I would do a login. After that you can return the folder's name to the app. Advatage: One app for all clients.

It might be better to store all data in a database structured and fast. As you've told you've got an own server. So PHP & MySQL is an option for you (call the PHP via OKhttputils). Very easy.
 
Upvote 0

Carthalion

Member
Licensed User
Longtime User
The log in is a great idea. I would prefer to not have to provide the individual apps.

About the database, good ideal also. I already have a MySQL database that serves the sites and stores client records. This is where the confidential data is, while the text files only store generic values like a loan ceiling or factor for mortgage insurance. Also, these programs are already in place. I used this same system for my Windows version of the software and it also works well.

I would still like to find out if there is a way to embed either a string or text file in the APK file.

Thank you for your feedback.
 
Upvote 0

fixit30

Active Member
Licensed User
Longtime User
I would still like to find out if there is a way to embed either a string or text file in the APK file.
You could declare a Process Global variable in the Starter Service which would be accessible to all your app.
 
Upvote 0

Carthalion

Member
Licensed User
Longtime User
OK, maybe I answered too fast or still do not know something. It does include the string value as part of the app. But it does not access it from the activity modules.

I could write this to a text file and then read it in each module. Is there a better way?

Thanks,

Carthalion
 
Upvote 0

Carthalion

Member
Licensed User
Longtime User
Actually I figured it out. To access a global variable from another module, you need to prefix the variable by the name of the module:

Dim MyName as String = "Carthalion" (in Process_Globals in Starter)

This works from another module:

Msgbox(Starter.MyName,"Name variable")

Thanks either way!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…