Coder Social home page Coder Social logo

macagua / plone_site_into_mobile Goto Github PK

View Code? Open in Web Editor NEW
1.0 5.0 0.0 4.4 MB

An Plone site as an apk (Android app with PhoneGap)

Java 51.37% CSS 3.98% HTML 1.80% JavaScript 39.85% Batchfile 2.21% Objective-C 0.79%
plone apk android-webview phonegap phonegap-app phonegap-application phonegap-examples plone-cms-site

plone_site_into_mobile's Introduction

Plone site into an mobile application

An Plone site as an apk (Android app with PhoneGap). In detail, this is a WebView Android.

Requeriments

  • Latest PhoneGap version installed.
  • A Plone site created using plonethemes.suite.
  • You need an accessable IP or domain name. For instance, we assume that your local instance is running on a server with the IP 192.168.10.66 on Port 8081

Configure Plone

  • Extend your buildout to include the egg zettwerk.mobile and re-run buildout.
  • Start your Plone instance, open the ZMI and create a Plone instance with id Mobile
  • After creation, switch to the Site Setup of Plone and click the Mobile theming link in the Add-on Configuration.
  • Change the field Hostnames to your IP and Port. For example: http://192.168.10.66:8081/Plone - now every visitor via this URL will get a different theme, than the default.
  • To choose which theme, the next field Theme Name is used. Choose the default zettwerk.mobile theme.
  • Click the save button
  • Now visit the portal with the configured Url and you should see the default jquery.mobile based theme.

Add a new theme

You can add new jquery.mobile based themes. This is easily done via the jquery.mobile Themeroller.

  • Open your browser and point it to https://themeroller.jquerymobile.com.
  • Use the themeroller to make customisation for swatch A (the left one). This is easily done by drag and drop colors to the demo area.
  • If you are finished, click the Download theme zip file Button at the top of the themeroller.
  • Enter the Theme Name, for example DemoTheme and click Download Zip
  • Now open your Plone instance and open zettwerk.mobile Themes in your Site Setup.
  • Click the Browse Button to choose you recently downloaded jquery.mobile based Theme and click Save.
  • The new theme gets automatically activated and should be visible when you reload your Mobile URL.

Create and the app

After phonegap installation, the phonegap tool should be available in your path variable. So you can create a new Phonegap project via:

phonegap create MyProject

The next step is to allow your app to access the plone instance. This is done by adjusting a setting in the generated config.xml. Open your favorite text editor and open the config.xml file, located in the www directory of your created project folder. Search the line <access origin="http://127.0.0.1*"/> and append a new line with (change the IP if needed):

<access origin="http://192.168.10.66" subdomains="true" />

Save and close the file. The last required step is, to load the content from your plone instance after the app is ready. This is done by editing the default index.js file, located in the www/js directory of your Phonegap project. Find the deviceready handler and change it like this:

onDeviceReady: function() {
    app.receivedEvent('deviceready');
    window.location = 'http://192.168.10.66:8081/Mobile';
},

Run the emulator

To test your newly created app, you can use phonegap to build the app and start it in the emulator or your connected device. The setup of emulators and devices for phonegap is beyound the scope of this readme.

For example to start the emulator with an existing emulated device just type:

phonegap run android

Examples

plone_site_into_mobile's People

Contributors

macagua avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.