Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
07/06/14 06:40 PM (10 years ago)

How Unique Must an .APK Be?

I am about to start creating the 12 (Android) versions of my (one) Map App. One .apk for each of 12 regions of the world. (I want to sell the 12 separately, and each has a unique dataurl for the locations for the Menu Simple and Location Map.) I want to ask for those of you who have published multiple Apps; How unique is any of your .apks vs another? Just in the "myAppName.apk", and/or also somewhere inside of the App? e.g. in the config.txt, we have the buzztouchAppId and buzztouchAPIKey. But in Control Panel, we also have Application Id and Control Panel Id. How much of what needs to be unique, in the .apk once on the customer's device?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/06/14 07:07 PM (10 years ago)
The 'name' of the app will need to be different for each device. myMap.apk is a unique name, and you won't be able to add 2+ of them in the stores anyway... myMap_asia.apk, myMap_euro.apk, etc... is probably something you should lean towards... Cheers! -- Smug
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/06/14 07:15 PM (10 years ago)
Excellent! I already have the 12 unique filenames.apk, was just wanting to double check on the internal code IDs. I'm going to offer the Apps to my core customers on my own, to see if any enhancements are needed before the Android stores. Are those right now Google Play and Amazon (?), and/or are there others? Do you think with iOS 8 looming, that I should hold off on the App store? My App right now is Menu Simple and Location Map. I do have ideas about using more plugins to do more things. The code fixes we worked through last week got the Location Map current location pulsing dot to be blue, and the rows to be solid black - using separate code, in config.txt, in the Android version vs. the iOS version. Do you think that actually should be addressed in one of the "h" or "m" files elsewhere in Eclipse (to get the Android rows to use the same command instruction that iOS uses)?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/06/14 07:47 PM (10 years ago)
I've never done anything but the google play store, so I'm not going to venture any info on that... Never hold off on the Apple App Store. They're not always the easiest to work with, and it might take longer than expected to get your app through. Also, shortly 'after' iOS8 is released they won't accept your app unless it's updated. Better to get it through now while there are no compatibility issues. Newer iOS versions will run it anyway... Make sure the 'last' thing you do before compile to publish is update your app BT_config.txt file with the "Live" version. When your app is released and available for download, you will still be able to make small changes and test them on your debug device, before pushing it out 'into the wild'. I usually copy from the control panel, paste and format with Jsonlint.com, and then copy/paste the 'pretty' version into my app, overwriting the existing text. If you've made changes to the config txt files "in the app" and not "in the control panel" they will be overwritten when your app gets updated. Therefore you'll want to either find a way to get the control panel settings to reconcile in your app, or change the code in each app to suit your desired appearance. Good Luck, and give a yell if you run into an issue. So far you seem to be doing fine :) Cheers! -- Smug
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/06/14 08:03 PM (10 years ago)
I was thinking about several of the points you raise. 1) "currentMode":"Design", Needs to be "currentMode":"Live", ?? 2) I haven't been making any changes in the Control Panel, and not clicking on the Publish changes button. I've been doing everything in Eclipse/Xcode. I fixed the Android menu rows in configA.txt - A for Android!! config.txt will be for iOS. The dataURL for my config.txt and configA.txt is not my Control Panel path, it is another directory. (One of 12, for the world region in question). Am I missing out on anything by not doing more with the Control Panel? I haven't really been all that beholden to it.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/06/14 08:10 PM (10 years ago)
As far as making the 12 versions of my App... the only thing different about each will be the 1) FILENAME.apk and 2) The one line in the configA.txt with the dataurl:. I wish there was a way - after renaming the filename - to edit the .apk configA.txt... withOUT needing to export it out of Eclipse. An .apk is a .zip file, using .apk rather than .zip as the extension. Unless I'm too nervous about the keystore... the keystore thing is the one thing wanting me to shy away from 12 exports out of Eclipse, each with the changed one line in the configA.txt with the dataurl:. And the filename.apk.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
07/06/14 08:33 PM (10 years ago)
I use the same release key for all my apps; regardless of app name. That shouldn't be an issue. Keep in mind the 'config' file is semi-dynamic. It's sent out with the App, and that's the config the app will use 'first', but when any change is published in the control panel, the apps will be prompted for a config refresh, overwriting the existing 'core' config. So any change you make to the 'core' config stands a pretty good chance of being overwritten someday, and usually sooner than you'd expect. If each version of your app is using the 'same' control panel, then you're going to need to step back and rethink your configuration plan. If I were you, a direction to take with respect to your dataURL's is to use a 'Merge Field' value to provide some information about where the user is located... http://www.buzztouch.com/docs/v1.5/mergeFields.php It'll take a little work, but if you can find out the coordinates for your regions, you can do an 'if/then' or 'switch' to determine which region the user is located, and drive the data appropriately. Cheers! -- Smug When I say 'if/then' and 'switch', I mean in your backend PHP Script, or however you're dynamically providing data... That way, regardless of 'version' the user ends up with, the data will be appropriate. Heck, you might consider 'one' version with attributes for all of them...
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/07/14 05:49 AM (10 years ago)
Smug is pointing you into the right direction. Instead of 12 identical apps with a few characters of difference within each, why don't you make one app with data being dynamically loaded through PHP calls from the server, probably according to the actual coordinates that the app would send to the PHP on the server. You seem proficient enough with PHP to be able to make it work!?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 08:27 AM (10 years ago)
I am proficient in (this level of) PHP. I use PHP to create a new config.txt, whenever I add/edit a new location. I then test the config.txt to make sure no errors in the JSON occurred while adding the new location(s), before making it available to the users. The critical issue here is that I do the PHP run on my side and on my time. I don't do a PHP run each time the user needs data. That would be remiss on my part, in testing the result of the PHP run, before giving the result (config.txt) to the users. And, that would be slower, a longer wait, for the user each time. I wrote a satisfying PHP script for adding a new location. It looks like an html form, asking first for the address, A submit button then processes the address through Google's geocode service, which obtains the address' latitude and longitude. On return, those values then populate the second half of the html form, for Lat and Lng. My first test for the validity of the Lat and Lng returned, is a Google map I embed on the page. I can zoom in, and look around. If the result is somewhere in outer space, I can edit the address. Google geocoding goes nuts if the address has human helping wordage, such as intersections in parentheses, e.g. (corner of 34th & Vine). The data set returned by Google geocoding also (can) include the country, state and city, although not reliably. I use those values to populate the country, state and city fields of my html form, and then if something doesn't fit, I edit to suit. And "submit" to add to my Array. I don't do SQL for small, flat Arrays. Since PHP4, and certainly since PHP5, the built-in serialize/unserialize function allows me to save/write/open/read an Array to and from a .txt file, wherever I want to save it. No SQL db/table set up, no secretive access, no waiting for another machine to communicate, while on the other hand, the ability to save a backup of the Array each and every time (before) I save a new version of the Array with updates - including deletes, which many webhosts don't allow one to do with SQL tables. My second test of the validity of the data is a PHP/javascript page, that puts all of the locations for that world region (my 12 Apps are for 12 world regions/travel zones that I have designated) on a Google map, using a technique called "cluster markers". The farther out you are zoomed, the fewer markers. The further zoomed in, the more detailed are the marker pins. If my world region is South America, and there is a marker pin showing in England, I can quickly, visually, determine that I have an aberrant geocoded location, and can immediately focus on fixing that one in question. But I do PHP ahead of time, and produce a 200k config.txt file, no waiting for one or more machines to be ready.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 08:35 AM (10 years ago)
Since 2010, much of my PHP/javascript work has been with Google Maps. It is one of very few things Google does, that isn't biased, edited, censored, unlike it's most well known service: searches, and lately it's books.google.com/Play marketplace. I have written PHP/javascript scripts that produce Google Maps with 1) Marker Pins, 2) Cluster Markers, 3) Polygons outlining a political candidate's voting district(s), 4) Polylines, that show my travels around the US, Europe and United Kingdom. I also used Polylines to show the migration of my ancestors from Wales, Belgium, Bohemia and Sweden, to the US. All using intermediate steps, to test and validate data before presentation.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/07/14 08:48 AM (10 years ago)
Config.txt is meant to hold the skeleton of the app, and you should use url fields in various menu plugins to fetch the data. That is how the system is meant to work. On the other hand, if you want to put 200k of raw data into it, you obviously can. To return to your original question, you can have 12 or more identical apps, presented under different names to Google and the public, but if the only difference amongst them would be the data, then you could consider creating one app which would be able to determine what to show to the user on the fly. Another angle: if you were to be a naive user of your apps/one app, which would you find more natural, convenient and usable, one app or more apps?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 11:44 AM (10 years ago)
Something is not working. My project in Eclipse is "travelmap". I have tested the App on my Android device, with the .apk named something more descriptive.. I just exported TravelMapAsia20140707' and downloaded it to the Android device using Chrome. In Settings > APK manager, I find the TravelMapAsia20140707.apk file, and tap on it. Dialogue box come up "Replace app? The app you're installing will replace another app. All of your previous user data will be saved"!!!!!!!!!!!!!! This is so wrong in so many ways. This is the only App in the list with this filename. The internal Eclipse project name is the same. It is a different App. Different filename (see above replies). It isn't replacing ANYTHING, it is a new App - filename and code within the project. Even if it was the same App, why would I want to save old data!?!??!?! I get new data from config.txt when I refresh. Now, in Eclipse the project is 'travelmap'. Must I change that to be unique?? 'travelmapAsia'? When I go to export out of Eclipse, I can't mess with 'travelmap', but the destination is fine with TravelMapAsia20140707. Or, can I NOT mess with the project name? Did Control panel export the .zip with internal references to 'travelmap' beyond just the main directory named 'travelmap'?? There's a: src com.travelmap gen com.travelmap Manifest references com.travelmap Argh, am I going to have to use Control Panel to export this 12 times????
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 12:07 PM (10 years ago)
Went to apk manager, and installed new App. After the warning messages that it would "replace" but keep old data!!!! What a disaster. New App wouldn't use the new dataurl!!!! So I went to apk manager and uninstalled the previously existing App. Dragging it from the Apps (Tic-tac-toe) menu to Trash, did NOT work. Went back to apk manager and installed the newly downloaded. App works great. But, I went through several steps to uninstall the old App, in order to be able to use the new App. I will need to tell users that they must do the same. They can have only one world region App installed at a time. I did do it... will every user level customer be able to?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 12:12 PM (10 years ago)
If a customer buys travelmapCanada and travelmapUSA... I would prefer the s/he be able to have both installed and running, and be able to just pick from either at any time. In the current situation, I would need to have them uninstall/install from apk manager each time. Not a pleasant thought.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/07/14 12:35 PM (10 years ago)
>Argh, am I going to have to use Control Panel to export this 12 times???? Yes. With enough different data in the Core section so that Eclipse and Google see it as a different app. From the Buzztouch point of view, you are doing everything wrong, that is why you have problems.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 12:38 PM (10 years ago)
That's not what SmugWimp said in his first reply.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/07/14 01:14 PM (10 years ago)
To really change the name of the app in Eclipse, you can first copy the app in the Project Explorer (Ctrl-C, Ctrl-V), then rename the package with F2 or using one of the following procedures: 1) Right click on the name of the app in the Project Explorer 2) Choose Properties 3) Refactor 4) Rename with Update References checked Another way is to use 3a) Android Tools 4a) Rename Application Package You can also create 12 different apps in the self hosted control panel. Then download them, import into Eclipse etc. Why have problems with just one app when you can have the same problems multiplied by 12? You cannot just change the final apk name and have twelve different apps. As far as Android ecosystem is concerned, it will be just one app all the way. You must change the name within the app, not from the outside of the app.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 01:20 PM (10 years ago)
Also, the dataurl config.txt file has a different url for the "backgroundImageURLSmallDevice":"****.png", "backgroundImageURLLargeDevice":"****.png", Than the Control Panel Core. The App is not respecting the statement in the new config.txt for "BT_items":, and "BT_screens", including specific child items. The App is using the .png included in the .apk only. Yet, if I leave the statement out, especially in the child items, the background will be white. I assume that has to do with cache. I will experiment with using a different ****.png name, like ****2.png, to get around the cache.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 01:22 PM (10 years ago)
I will work through your suggestion, right after dinner. First, since I use Mac, I'll try to figure out what an F2 is. :) :)
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/07/14 01:27 PM (10 years ago)
You do not need F2, the other two methods should work everywhere.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 05:10 PM (10 years ago)
I'm thinking I have a newer, or at least quite different version of Eclipse. (Rather than complain that none of what you wrote worked). My Eclipse is per Mark's video tutorial, Android Developer Tools, Build: v22.6.2-1085508. https://www.buzztouch.com/forum/thread.php?tid=5C1FA571B8583B8F2FD062A&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 1) In Package Explorer (I do not have a Project Explorer), copy/paste "travelmap", produces "copy of travelmap" with a half-dozen red Xs. Project > Clean does not remove the red Xs. 2) Right click on "copy of travelmap" > Choose Properties > Refactor > Rename with Update References checked There is a right-click properties... but no Refactor there. There is a right-click Refactor with Rename and Update References checked. There is also a menu option for Refactor. Right-click Refactor with Rename and Update References checked, does not remove the Red Xs. Successive Cleans does not remove the red Xs. Just by copy/paste, gives an AndroidManifest error: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> src is still com.travelmap, with a red X. BT_activity_host-java has 6 red Xs. And about 10 more files in src with red Xs. I've looked for Android Tools. Under Refactor > Android there is no tools.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 08:15 PM (10 years ago)
I successfully edited my App in my Self Hosted 3.0 Control Panel, to make it unique (Europe). Exported. Imported into Eclipse. Did the repetitive steps per Instructions.pdf. Clean. Run. Simulator was fine. Exported. Uploaded to webserver. Downloaded to device. Device did not want to "replace". App launched. Refreshed all data. App used correct icons. Just in time for end of day. Sad that the Refractor stuff didn't work, but the steps were not as painful after a few tries, as feared.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 08:20 PM (10 years ago)
2 Apps now co-exist on my device. Practice makes perfect.
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
07/07/14 09:31 PM (10 years ago)
>Practice makes perfect Great!
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/07/14 09:41 PM (10 years ago)
I will need to do it once more, perhaps just in Eclipse, as I did not take the time to have the correct icon for the Europe version .apk. config.txt calls the correct icon for the MenuSimple screens, but that's not about the device icon. Not a big deal. That will take a little thought for tomorrow. Oh, I did a little experiment: I made a copy of the .apk, changed the extension from .apk to .zip, double-clicked, and sure enough! Out popped a folder, containing all the goodies inside of it! I first learned about .zip files being called by other extension names, when I did a book project a couple of years ago, and found that .epub eBooks, were actually .zip files called .ePub! Then I could make my own .ePubs, following a very precise structure, of files and folders, then zipping it, and renaming it .ePub. "Pay no attention to that man behind the curtain!".
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/08/14 01:36 PM (10 years ago)
Sigh... LocationMap is now broken. In the new Android package made last night. https://www.buzztouch.com/forum/thread.php?tid=425CEE493E7928CD3C23891&fid=06DB0BCB08E3333&sortColumn=FT.id&sortUpDown=DESC&currentPage=1 There was an update for it last week, so I updated it in my Self Hosted Control Panel. Didn't change anything else in the Core or config.txt. Previous .apk version - before I renamed it - still works on my Android phone.
 

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.