0

I'm working on a cordova hybrid appliication. I want to have separate html views based on compatibility. The issue came in with angular material design not working too well on older devices. I don't want to scratch the material design screens for everyone. My plan is that newer devices will run one set of views while older devices run another. This split will be based off device type and OS version.

My initial thought was to have two separate index files specified for different builds. So the split could be based off a flag in my gradle build. Leaving me with 2 builds, one for new devices and one for compatibility's sake. Any ideas?

1 Answers1

0

based on http://docs.phonegap.com/en/1.0.0/phonegap_device_device.md.html you can get the "device.version" and indeed execute differente code depending on the version.

Lary Ciminera
  • 1,270
  • 8
  • 15
  • The thing is I want my javascript to be consistent across both versions, only my html should be different. I want a clean solution where either one of two html sets are used based on a flag in my gradle build or something like that. So same functionality but different look, changing javascript to check the version requires many changes. – EJ_Westhuizen Oct 27 '15 at 14:28
  • well you can the load the html you want depending on the version (http://api.jquery.com/load/ for jquery) (http://stackoverflow.com/questions/24496201/load-html-template-from-file-into-a-variable-in-angularjs for angular) – Lary Ciminera Oct 27 '15 at 14:31
  • This would still require a modification to every controller that I have? I might be understanding this incorrectly, but this solution is to load html into a view, it doesn't replace the entire view? Sorry if I am mistaken, I'm used to android specifically, I'm new to hybrid html apps. – EJ_Westhuizen Oct 27 '15 at 14:49
  • mmmh i don't know angular very well but can't you just redirect to a file let say `window.location="index_ios7.html";` or `window.location="index_ios6.html";` that use the same controler? – Lary Ciminera Oct 27 '15 at 15:05