8000 GitHub - davidwood/sigi: An application framework for developing Android applications using web technologies · GitHub
[go: up one dir, main page]

Skip to content
davidwoodPublic
forked from voltron/sigi

About

An application framework for developing Android applications using web technologies

Resources

Stars

1 star

Watchers

1 watching

Forks

 
 

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Sigi

Description

Sigi is an Android application framework for building native Android applications whilst using web technologies.

Coming soon: how to build a full Sigi app! Use the following to get started or check out these demos:

http://github.com/voltron/whoopingkof/tree/master/clients/android/

Creating a Sigi Application

NOTE: The following assumes you know how to build a standard Android application using Eclipse or your favorite IDE or text editor.

Create a new Activity and change the class definition so it extends com.sigi.Sigi, not Activity.

Now, you need to add your extensions.

Creating a Sigi Extension

Create Interface ( IFooJS.java )

Add methods that will only be exposed to window object in WebView.

public interface IFooJS { 
	public String say(String word);
}

Create Class Implementation

Implement methods of interface and extend AbstractWebViewExtension abstract base class.

public class Foo extends AbstractWebViewExtension implements IFooJS{}

Add the JavaScript Interface in initialize Method

public void initialize()
{
		// Add JS interface
		webView.addJavascriptInterface((IFooJS) this, "Foo");
}

Implement Methods

Implement interface methods in class definition.

public String say(String word){
	return word+ " from Java";
}

Add Extensions

In App.java (main app file), import your extension and create an arraylist of extensions and add your extension to the list inside the activity.

import com.myapp.foo;

/* In activity */
private ArrayList extensions = new ArrayList();

/* ... deeper in the Activity ... */

extensions.add(new Foo());

Call it in JavaScript

In your JavaScript file, call method like so:

var text = window.Foo.say('Text from JavaScript as well as ');
alert(text); // alerts "Text from JavaScript as well as from Java"

Authors

About

An application framework for developing Android applications using web technologies

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

0