You must Login before you can answer or comment on any questions.
I have a working rss podcast feed on iPhone that when run in Android emulator crashes. It worked up to when the items are displayed in a tableview but when item is clicked, the app crashes and restarts with nothing else. I am thinking I need to code-branch on what needs to happen if OS is android. But I don't know where to do the branching or how to the branching, or worse still what to branch to. I hope it is possible to access RSS feed of podcasts in android.
Please help point me in the right direction; this app is almost complete if only this function will also work on android. I looked at a similar task (CNN radio news) in Kitchen sink but noticed it was only for iOS; nothing on android.
The problem you have may not be iOS/Android specific so my suggestion is find the actual issue before doing anything else. You can do this effectively in this sort of issue by using liberal amounts of Ti.API.info, I would place one on every other lines of code in the affective part. When you run the app the console will show how far you get through. That becomes you debugging starting point.
Ti.API.info('feed issue', 1); var x= y; Ti.API.info('feed issue', 2); var p = 89; Ti.API.info('feed issue', 3); ...If you really want to use branching - after you have solved your problem, then it is much easier than you may have thought. But you should plan things as branching can actually lead to just creating two versions and that is not the smart move. You should ONLY split things when they are actually different in presentation or reaction to events or external factors.
If you are not already then you should investigate CommonJS.
By creating your code in re-usable module patterns you focus on the end result rather than the UI/UX. So you can have that in specific CommonJS modules - you just place them in their respective folders.
Standard way - Imagine you are creating a UI module you may have a folder layout like and place it inside the most logical place;
/android/ /iphone/ /assets/ /ui/newmodule.jsYou would then reference this in your code as;
var NM = require('/ui/newmodule');In branching you simply create two versions, place specific code into the distinct versions to handle the problem as best for THAT device.
/android/ui/newmodule.js //the android specific version /iphone/ui/newmodule.js //the ios specific version /assets/ /ui/ // nothing related hereYou STILL reference this in your code as;
var NM = require('/ui/newmodule');Just now it checks the Android folder for the android specific version and if running on iOS it looks in the iPhone folder.
If you are only talking a couple of minor differences then simply use if statements on Ti.Platform properties.
Think you can help? Login to answer this question!