How to use includes on PhoneGap – An Introduction to PhoneGap Extensions

 

Nowadays developing multi-platform mobile applications is a big challenge for software engineer. The options basically are native applications, mobile paid engine platforms such as AppAcelerator and PhoneGap. Every approach has its advantages and problems and if you are reading this article you probably know that.

PhoneGap is a very nice platform. There you can really build multi platforms applications and its extensibility through plugins is amazing!!! On the other hand issues such as performance, how to create a really native experience remain. Software Engineers should provide solutions for these questions.

Another question in my opinion is how to reuse the HTML code. In my opinion to maintain code is a very serious problem when you consider using PhoneGap for serious business applications. Yeah you can use JavaScript and UI Frameworks such as Sencha Touch but you have to consider that use Java Script templates has performance costs and is created to solve other kind of problems.

So I how I could create an html5 file that reuse other file. That would be very useful and I didn’t find any open source solution to do that. That was the first reason to create this project.

After 3 days using my spare time I created an alpha version that just work on Android platform.

This is a simple example about how that works:

<html>
  <head>
    <title></title>
    <script src="js/example.js"></script>
  </head>
  <body>
    <phonegap:include file="includes/header.html"/>

    this is a test file.

</body>
</html>  

I really would like to find other developers to help me to translate the same idea for other platforms.

Last edited Jun 19, 2011 at 9:05 PM by kellyoliveira, version 1

Comments

No comments yet.