Discussion Forums  >  Uncategorized

Replies: 5    Views: 178

chrspe
Android Fan
Profile
Posts: 95
Reg: Jan 07, 2012
Buffalo, WY
5,400
02/04/12 09:53 AM (14 years ago)

Enter Option: Custom URL

Trying to figure out if BT15 can do this and how. Currently I make the same custom app for different facilities. When you hit the phone icon it takes you to a custom URL login page for a controls system. This URL is different for different locations. The url would be something like http://xxx.xxx.xxxx/file/remote/index.html , so I make a new app with the x's replaced. Is there a way to build this app one time and when it is set up for a new location they hit the options button and enter the xxx.xxx.xxxx, then the code inserts this into where it needs to be and directs it to this new url?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/04/12 11:11 AM (14 years ago)
The easiest way to do this is to take a moment to try to understand how the BT_strings.m file merges info into URL's. If you can't use the pre-defined merge fields you see in your control panel, you could create your own. The challenge I see with this idea is this. If you build the app once, and want to deploy it to different users, you'll need to know what use is using the app BEFORE you'll be able to merge the right domain name - right? If you don't know the user, how will you know what URL to use. Because you're re-using the same app for multiple facilities, each with their own icon on the phones desktop, you'll always need to rebuild the app for each location anyway. iOS won't let you change the phones icon in your code, this is compiled into the project. If you're compiling everytime anyway, it seems trivial to enter the URL in the project for the login. Maybe I'm missing something.
 
chrspe
Android Fan
Profile
Posts: 95
Reg: Jan 07, 2012
Buffalo, WY
5,400
like
02/04/12 11:22 AM (14 years ago)
The end user would enter their url. Everything else would remain the same, icon and index directory. I do this in a local couple states but was thinking I could teach other people across the world with a little training and an app where they just enter their local url. They would go into their control program and create the directory that the app will read. I dont know, maybe the bigger money would be to compile a custom app for each location, have them give me their url and me compile. All the web xml pages reside on their control server, the only thing the app does is direct them to the login page.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/04/12 02:57 PM (14 years ago)
If I wanted to create a screen to allow the user to do a Google search for puppies and ? . Example: puppies & Arizona ? being something the user would enter how would this be done? Fred
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/05/12 01:19 AM (14 years ago)
I think both of you are up against the same concept - how to find n replace in Objective C. It's not too tough and you can see a sample of how we do it in the BT_strings.m file. Have a look at the mergeURL method in that file. The idea... a) You have a variable holding a canned URL with a placeholder like... http://www.DOMAIN.com/login OR http://www.google.com/?[SEARCHTERM] b) After the user makes an entry and submits whatever screen you're using to gather the data, find-replace the canned placeholder string in your URL with the entered value. Again, have a look at how we do this with the built in Merge Fields in URLs. You'll see the idea then create your own cool little function to do the same thing. The merge function (method) in BT_strings takes a URL as a parameter (passed in as a string) then returns the same thing after merging. You could copy this method, rename it, then change it's functionality.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
02/05/12 03:58 AM (14 years ago)
May have solution. Send url for test. Send one sample data entry. See name for email. Fred
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.