是否可以从Wordpress博客中创建PhoneGap应用程序? [英] Is it Possible to create a PhoneGap app from a Wordpress blog?

查看:142
本文介绍了是否可以从Wordpress博客中创建PhoneGap应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从Wordpress行动网志制作 PhoneGap 原生应用程式?

Is it possible to make a PhoneGap native app from a Wordpress mobile blog?

我知道 PhoneGap 可让您开发HTML5应用程式,并将它们转换为原生移动应用。

I understand that PhoneGap allows you to develop HTML5 apps and turn them into native mobile applications.

我想要创建一个内容分发应用程序,有点像那么多本地新闻服务使用( WGAL 频道69新闻),但是能够在Android Market Place和AppStore中列出,以及能够在线访问所有相同的内容。

I'm looking to create a content distribution app somewhat like the ones so many local news services use (WGAL, Channel 69 News), but to be able to list it in the Android Market Place and the AppStore, as well as be able to access it online all with the same content.

也有任何替代方法来完成这个?

Also are there any alternative methods to accomplish this? Are News apps like that available in some sort of a "canned form"

推荐答案

一种方法就是让PhoneGap成为一个网站浏览器没有地址栏。我有一个iPhone示例在这里。我所做的是在加载应用程序时使javascript重定向,将我的IP列入白名单(在本例中为本地主机),并使用这段代码修改 Appdeligate.m from:

One way is to essentially you make PhoneGap a web browser without an adress bar. I have an iPhone example here. All I did was make javascript redirect upon loading the application, whitelisted my IP (in the case of the example it's local host) and modified the Appdeligate.m with this piece of code from:

- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
    return [self.viewController webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
}

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
    NSURL *url = [request URL];
    if ([[url scheme] isEqualToString:@"http"] || [[url scheme]isEqualToString:@"https"]) {
        return YES;
    }
    else {
        return [ super webView:theWebView shouldStartLoadWithRequest:requestnavigationType:navigationType ];
    }
}

和voila到基于web框架的所有本地资源(存储,摄像头等)!天气或不是苹果或其他人会让这样的东西在他们的应用商店我仍有待调查,但它一定能很好地演示目的或个人应用程序。

and voila, a "native" app, with access to all local resources (storage, camera, etc) built on web frameworks! Weather or not Apple or the others will let something like this in their app store I still have yet to investigate but it sure works well for demonstration purposes or personal apps.

这篇关于是否可以从Wordpress博客中创建PhoneGap应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆