I've been working on a Phonegap project (Android and iOS) for 2 months now. Everything works fine and is surprisingly fast once you play around for a while.
Except one thing. I fail to understand how Phonegap handles icons. After a while I have noticed that the "res" folder for my iOS project wasn't being used, instead it was using icons in "platform/ios/projectName/Resource/icons". I've moved all my icons/splash screen in there, linked all of it in my xcode project and everything work fine.
Now I'm struggling with Android, hacking my way in that "drawable" folder of the Android platform folder, failing to understand the role of the config.xml in all of this.
Anyway here are my questions:
What is the purpose of the icon references in "www/config.xml" if when it comes to building for a platform, it ignores those paths and actually looks for icon/splash screen elsewhere?
What is the purpose of the res folder/subfolder naming, if the build function just blindly copies everything in each platform folder (having blackberry references/png in iOS config/folders).
Where should I put the android splash screen image and what's the correct naming? (when i copy the one from "www/res/screen/android" into the "drawable" folder, the build fails for incorrect naming).
Basically, what's the Phonegap expected workflow for icons & splashscreens?
The references listed in config.xml are for Phonegap Build. This link might help:
http://devgirl.org/2013/09/12/phonegap-icons-and-splash-screens-help/
Related
I am developping an app on Ionic version 3.9.2, for android tablets. I am working under windows 10 with Visual Studio Code.
In my plaform folder, I have only one device : my physical Android device.
The way I process to fix some CSS details is that I simply launch a
ionic serve command, find my HTML element, and update the main.css file located in the www/build folder (I am not using SCSS).
This works okay until I decide to check if everything looks good on my android tablet : I will launch a cordova run android, and then all the CSS changes are lost - even if I go back on my browser, and launch a new ionic serve.
Please note that I am talking about very basic styles, like colors and font size, not platform-specific styles.
I am not sure this behavior is because of the target device itself; it's looks like the changes will be included successfully on my testing platform until I decide to change the platform, and then the new platform will erase my changes because it's taking over the building process.
Is that possible ?
Maybe should I stop switching between those 2 commands ?
Or maybe should I edit both CSS files (www/build/main.css and platforms/android/assets/www/build/main.css) at the same time, which require a lot more work ?
Any help appreciated.
Oh of course, I shouldn't edit this CSS file.
Instead, edit the right SCSS file inside the SRC folder.
Thanks for your answer.
I wish I could just ask this question in a sentence, but I'm not that concise:)
I developed a cordova app which I turned into a git repo. Later this app turned into 30+ apps -- all basically the same with branding differences.
I decided the approach to use would be to leave my original app as the 'master' and then create branches for each of the branded versions. I would always make edits to 'master' and then pull/merge those changes into each of the branches. They all share 98% of the same code, so that seemed to make sense.
By and large it seems to work ok (on app #2) but I am running into a really annoying thing I can't figure out.
Each time I switch between branches, the platforms/ios and platforms/android directories get bunged up with extraneous files. Since the apps are branded/named differently, some directories/extra files carry over. Even when I go through and remove them I still can't build without errors unless I:
- ionic platform rm ios
- ionic platform add ios
...which is simple enough but I then have to move all kinds of custom native code files in place.. and it seems like I should be able to manage this better.
I tried adding the 'platforms' directory to .gitignore but then ran into other issues. I may have to revisit that method, but is there a recommendation for how I should structure these apps that all use most of the same code?
Looking through the documentation (https://facebook.github.io/react-native/) it seems you need 2 different files ones with file ending in .ios the other .android
I find it hugely confusing now I'm starting to write code do I need 2 repos to write this code
Yes, you do need to write to the specific platform you are working on at the time. If you are working on iOS / Xcode, then the .ios files will automatically be the once run when compiled, and vice versa.
If you are not writing any platform specific code, you can copy the code from whatever components are working on in your current platform over to the other platform, and they should work fine there.
You could use some strategy to share the same code base.
I found a project where it was made:
Mobile, desktop and website Apps with the same code -
https://github.com/benoitvallon/react-native-nw-react-calculator
I have a simple HTML+JavaScript app that compiles okay in the Adobe PhoneGap Build service. I use Hydration there. I can also run locally with the Adobe PhoneGap Desktop App. But multiple things defined by config.xml seem to have no effect in either case:
The app icon, of which I have multiple defined for each platform, isn't used. Instead it's the Adobe PhoneGap icon (this could just be due to Hydration?)
The splash screens, also defined for each platform, are not used. I tried adding SplashScreenDelay to no effect.
No plugin seems to work. I can't even get something simple like device.platform (provided by org.apache.cordova.device) to return a value.
The Adobe PhoneGap Build service is supposed to pull the plugins via npm as part of the compilation, right? Does the Desktop App do the same? Am I missing a step somewhere?
Pastebin: config.xml (Mostly stock, just added com-admob-plugin and SplashScreenDelay)
Remember, in order for the config.xml file to be parsed it MUST BE IN THE SAME DIRECTORY AS INDEX.HTML!!! Otherwise the PhoneGap Build service will just compile your application with the presets. Moreover, read this for more information.
I just started using intellij and I just noticed that when it sets up your initial res folders it does not include the Drawable. I know that I can just add the folders no big deal, I was just a wandering why. Then again maybe I have done something wrong.
As you can notice from the log in this video, res/drawable* folders are created by Android SDK tools. It's not handled by IDEA, it's a feature of Android SDK.