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

Colors and Backgrounds Not Working in And, is Working iOS

I mentioned this in another thread that many of you might not have taken an interest in. After a lot of hurdles, I got my iOS App working on my iPhone 5S, and my Android App installed on my Android device "Visual Land". The Android App functions... but unlike the iOS App, the menu row color and the background file are not what's being called for in config.txt. I was wondering if anyone had been through this. Here's the screen capture: http://www.10kapps.com/CodeSample2Screens.png
 
mysps
Code is Art
Profile
Posts: 2082
Reg: May 14, 2011
Palma
33,320
like
06/06/14 11:20 PM (10 years ago)
Did you import the background image in the project and copy the config file in the project just to be sure?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 04:07 AM (10 years ago)
To confirm the location of your background image files, they need to be in res/drawables folder. As the menu row colour isn't picking up, it suggests the latest config.txt hasn't loaded into your app.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 08:47 AM (10 years ago)
As I was falling into bed last night after a 15-hr day on this and other programming things, and after the success of getting the App out of Eclipse with no errors, and the Map working with the Google API, my mind suddenly realized that indeed I had not dropped the background image into any folder on Eclipse (partly because someone somewhere here said there's no dropping anything (Plugins or Art compared to the iOS package in Xcode) into Eclipse, and partly because the BT 3.0 instructions.pdf doesn't include that)... and that would be today's first effort!! As for the background image, the two options that I see are; 1) include in the .apk via Eclipse, and 2) reference it by http (URL) in config.txt. I'm going to try the latter first, as I kind of like having the config.txt file be immediately responsive to change. The thing about Eclipse res/drawables, is that there are FIVE src/drawable* folders!! src/drawable src/drawable-hdpi src/drawable-ldpi src/drawable-mdpi src/drawable-xhdpi As for the instructions.pdf that comes with the BT Self Hosted Control Panel exported .zip. there's no reference to src/drawables! Only: /assets/BT_Docs Put .HTML, .PDF, .DOC, and other document based assets in this folder. /assets/BT_Video Put video files in this folder. /assets/BT_Audio Put audio files in this folder. That document is a bit wordier than it needs to be, but lacking in the reference to src/drawables.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 09:38 AM (10 years ago)
So the first road-block this morning is: "backgroundImageNameSmallDevice":"bkgds.png", "backgroundImageNameLargeDevice":"bkgdl.png", Changed to: "backgroundImageNameSmallDevice":"URL", "backgroundImageNameLargeDevice":"URL", ...fails to work. The URL is quite valid. In the URL, the images (filenames) are the same as what was dropped into Xcode BT_Art > Icons - and not dropped into Eclipse :). The error log in Xcode: Image for background view does not exist in xcode project, or in cache and no URL provided, not downloading: http://URL So the instructions are incomplete. I did a Google search on the topic, and came up with no examples. Didn't work in Android either, so I'm suspecting that the statement "backgroundImageNameSmallDevice":"URL" is not complete.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 09:55 AM (10 years ago)
Put your background image into src/drawable, or link to the URL if it lives on the internet, not both though.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 09:57 AM (10 years ago)
Not dropped in src/drawable yet. As I stated, putting the URL in config.txt didn't work.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 10:01 AM (10 years ago)
You are using the control panel, not editing config.txt aren't you?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 10:16 AM (10 years ago)
config.txt. Just as editing config.txt as I do to add more menus, menu items, and locations for my Map. No instruction said we had to put anything in Control Panel > Theme > Background Image. I am now editing Control Panel > Theme > Background Image with the URL, and going through the dance of dropping in all the Art and image.xcassets .pngs, and then the signing, and the build architecture... See you AFTER lunch.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 10:31 AM (10 years ago)
The only way I know is to use the control panel. Everytime you edit in the CP it recreates the config.txt. That is a big part of how buzztouch works.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 10:38 AM (10 years ago)
If you HAVE to do it in Control panel, and export the whole .zip again, it suggests to me that it adds that to other files in the .zip in addition to config.txt. The fact that I can edit config.txt to add menu lists, menu items and locations for my Maps, led me to just edit config.txt for background images. What I don't like about that, is that is constrains my creativity later, in case I wanted a different background image for one menu list, under a certain circumstance... e.g., if I have three menu lists, Country, City, Category, and it was December, I might want a holiday theme background for the Category list. The way do to that is the PHP script that writes the updated config.txt, and if date("m")==12, change the URL to a holiday.png. If I can't do that, without exporting a whole new .zip, that's unnecessarily restrictive. I really only want my customers to download a new config.txt when I add informational updates. If I add a new plugin, then that's a different story.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 10:50 AM (10 years ago)
This assumption is not correct "it suggests to me that it adds that to other files in the .zip in addition to config.txt." Config.txt is the file that refreshes your app when you make changes in the control panel. It refreshes over the internet. Change setting in the CP (e.g. a background image) and the app updates. You don't need to re-export and create a new zip.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 11:12 AM (10 years ago)
Between: 1) editing Control panel > Theme > Background to add the URL for the background image... 2) editing config.txt to add the URL for the background image... "backgroundImageNameSmallDevice":"bkgds.png", "backgroundImageNameLargeDevice":"bkgdl.png", vs: "backgroundImageNameSmallDevice":"URL", "backgroundImageNameLargeDevice":"URL", In any situation where I am using URL, Xcode error log says the URL is empty... or something similar. I deleted it. And on the device, the background is black. When I revert to stating "filename.png" I see the background image just fine. Kind of the same with Android, putting the .pngs in the src/drawable folder, except there is a white margin on the left of the background image, and the menu rows are still gold letters on white. Anyone else using URL for their screen background images?
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 12:36 PM (10 years ago)
This does work, I have used it a lot, never had a problem. So, just to clarify for us that would like to help, how and where are you providing the url for the image that doesn't show?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 12:46 PM (10 years ago)
In the .png screen shot from 06/06/14 10:15 PM (14 hours ago) In every instance of BT_screen_menuListSimple: "itemId":"552B4A5DD4E2AC5AA85EACF", "itemType":"BT_screen_menuListSimple", "itemNickname":"Travel Map", "navBarTitleText":"Travel Map", "listRowBackgroundColor":"#000000", "listTitleFontColor":"#FFFF33", "backgroundImageNameSmallDevice":"bkgds.png", "backgroundImageNameLargeDevice":"bkgdl.png", "backgroundImageScale": "bottom", "childItems":[ When I use URL rather than *.png, the format is: "backgroundImageNameLargeDevice":"http://myDomain/path/bkgdl.png" In the BT_screen_customHTML plugin, we use a slightly different scheme for calling a file via http: "itemType": "BT_screen_customHTML", "dataURL":"http://myDomain/path/filename.'.txt" And at the beginning: "BT_themes": [ { "itemId": "A96D36619DA3D9651059CAE", "itemType": "BT_theme", "itemNickname": "AppTheme", "splashScreenItemId": "", "statusBarStyle": "default", "navBarStyle": "solid", "navBarBackgroundColor": "#FFFFFF", "toolbarStyle": "solid", "backgroundColor": "#000000" } No reference to "background image" in this first JSON. When I did edit the Control panel 2 hours ago, it did put the same background image lines in as the above example which is the working config.txt.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 12:48 PM (10 years ago)
btw, the json you posted would not give yuo the result I think you are after. As an example it should be more like "backgroundImageURLSmallDevice": "http://www.yoursite.com/images/bkgds.png", "backgroundImageURLLargeDevice": "http://www.yoursite.com/images/bkgdl.png", If you enter the values that you want into the control panel, you can get the correct json values from there. I believe you are building or serving the config.txt for your app in a different way to the standard, which sounds cool - I don't know how to do that But using the CP when gives you an insight into what the json is that you need.
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 12:59 PM (10 years ago)
There we go: backgroundImageURL vs backgroundImageName Does cause both devices to use the .png from the Internet. However, the next hurdle has to do with device rotation. It doesn't know to use a landscape image when rotated. Therefore, it centers the "portrait" image, when I rotate the device. iOS centers it, Android puts it flush right! At least it doesn't manufacture a wildly stretch image to fit! :) But I would like to have it use one of my already created landscape images when the device is held in that way.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
06/07/14 01:50 PM (10 years ago)
You are welcome
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 02:14 PM (10 years ago)
And, I wonder what is conflicting in Android, that it won't make the menu list row text black as specified - yet iOS is fine with it: "listRowBackgroundColor":"#000000",
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 03:11 PM (10 years ago)
I'll be looking into this, but I worry about conflicts between Xcode and Eclipse, plus it means the need to export a new .zip - the the dance that goes with Xcode. http://kittsy.co.uk/change-background-image-based-on-orientation/
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
06/07/14 10:05 PM (10 years ago)
If I can't get the black row color to work in Android, should I just change to black text?
 
Nicks App
Code is Art
Profile
Posts: 426
Reg: May 21, 2014
Las Vegas
6,010
like
07/03/14 10:59 AM (10 years ago)
 

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.