Skip to content

Instantly share code, notes, and snippets.

@triceam
Last active Dec 11, 2015
Embed
What would you like to do?
Transcript from Open Session on PhoneGap 01/17/2012
Q: I need to pay to upload my app at the google play store or necesary i need to buy a google dev account?
A: Yes, while PG is free, you have to pay Google (and Apple, and MS) for a Dev Account. Google is cheap though - I think 20 bucks.
Q: lukas: i would like to ask when we use google maps api v3 in phonegap app, is there any way to do it a little bit faster? cause we are experiencing performance problems and for example caching of the maps area i have already seen is not functional
A: We do not control the Google Maps API. However, you can use any 3rd party javascipt API. I (Andy) have had a lot of success using Leaflet with Open Street Maps, however this is not the exact same API as Google. There isn't necessarily a technical reason that the Google API would not work, since it is contained within a webview.
To add to this - you can also use the Google Static Maps API. It doesn't allow zooming/panning, but it returns maps as simple graphics.
Q: if i make a php document on Dreamweaver can i get a phonegap package from this?
A: PHP runs on a server. So when a user requests foo.php, your web server asks PHP to run the program and return HTML which gets returned to the user. You can't run PHP in a PhoneGap app. *However* - you can build remote-accessible services with PHP. FOr example, a service that returns JSON data. Your PG app can use JavaScript to hit that URL and work with the result.
Q: ans also i can make a package of phonegap with a SQL database?
A: PhoneGap has the ability to use an embedded local database via the Storage API (based on WebSQL, much like SQLLite). In order to talk to a remote database, yo umust use an application server. Basically, the phonegap application communicates with the server (apache, iis, - php, .net, coldfusion, etc...), which then communicates with the database. The most common approach I see is having the server expose a REST service, which PhoneGap will communicate with.
Q: What's the most important when i begin to build mobiles apps desing or productivity?
A: Obviously this is a bit of a open ended question. I think a good product thinks about _all_ issues when being developed. User experience. Productivity. Security. Etc. I'll be honest and say I kind of wait for design (I'm a coder) though when I build. Design is critical for getting started - whether it is a simple wireframe mockup or a pixel-perfect UI is up to you as the des/dev. However, wireframe designs are critical in kicking off development.
Q: i know this has been asked a million times but when is PhoneGap Build going to allow the use of Plugins? Specifically, Pushwoosh
A: Chris answered this already - we support 3 now - and more may come later on. The issue with supporting plugins is that we become beholden to other projects/devs, so it is a bit difficult to add in many at once.
Q: can you post the code for an app with great functionality - i like to learn by looking through to see how it's built
A: There are lots of examples on Adobe evangeslits blogs. mine is http://www.tricedesigns.com Ray's is http://www.raymondcamden.com/, also check out Christophe's at http://coenraets.org/blog/
Q: Which are good tools to debug (like firebug) hybrid apps?
A: The PhoneGap emulator is crucial. It is a Chrome plugin, available here: http://emulate.phonegap.com/ (based on ripple emulator). On OS X, you can also use Apple's developer tools with Safai. From Safari, you can connect to the iOS simulator or to an iOS device and perform on-device debugging complete with breakpoints & dom inspection, etc... There is also debug.phonegap.com for remote app inspection.
Q: What's the best way to get started with doing live data syncing in mobile apps?
A: This is a tough question b/c there are so many different development paradigms/technology options. Can you be more specific on what you are trying to do?
Adding to this: Slowly. :) If you search my blog (raymondcamden.com) I've got an entry on it. Basically it boils down to a syncing strategy. Ie, when you start the app, you can ping your remote data source to ask for 'new' data. You can look at your local data nad see what's new. Then you push up, and push down. Conflicts can be messy. You have to decide which is "more important" - local client, or server. Technically syncing isn't a big deal. It's the 'rules' that are difficult.
Q: as new standardisation occurs for HTML5, how quickly will these become able to be implemented within phonegap?
A: PhoneGap is based upon the system web view for each supported operating system. These features will be available as soon as the operating system supports them. PhoneGap does not manage each OS, so we can't give a precise date. However, there is no delay between OS support and PhoneGap support.
Q: Do you think it is a good thing to use a "template system" to build a phonegap app? What are the advantages and inconvenients for you?
A: Personally, I like them. Once you try to create lots of dynamic HTML w/ JS, you realize how painful it is. A solution like Handlebars is great I think. I will point out that most of these solutions allow you to precompile your templates for performance, and I'd definitely recommend that.
Q: What's the best way to post cross-domain from within a phonegap app?
A: PhoneGap can communicate with any server, without cross-domain restrictions. All that you need to do is white-list the domain, and it will be unrestricted. You can read more about white-listing domains here: http://docs.phonegap.com/en/2.3.0/guide_whitelist_index.md.html#Domain%20Whitelist%20Guide
Q: Timeframe for PG 2.3 on PG Build.
A: Sorry, don't know. It shouldn't be long.
Q: WebSQL is no longer apart of the HTML5 spec, Do you think it is still ok to use it for local storage in the long term?
A: Sure, I think it is safe to use. For one, even if PhoneGap 5 removes it, it won't stop your existing apps from using it. Also, even though WebSQL is "dead", it is still supported VERY well on mobile. The future may be IndexedDB, but we are a long way from having any spport for that. So imho, I'd continue use it. I would not use it for desktop apps though.
Q: In terms of taking a web app and making it a phonegap app. How much of phone gap should be used to not get rejected
A: This is very subjective. PhoneGap does not come into play for the approval/rejection. It is about the application experience, and how the technology is implemented on the mobile device. Please read this article for a much more comprehensive answer: http://www.adobe.com/devnet/phonegap/articles/apple-application-rejections-and-phonegap-advice.html
Q: Does Phonegap support the new BlackBerry 10 "web works" SDK? I'm hearing a lot about their upcoming platform...
A: Yes, please see this article for additional detail: http://devblog.blackberry.com/2012/11/phonegap-blackberry-10/
Q: Any tips for storing data securely on device? I know this is more of a web question but it's very relevant when it comes to PhoneGap (for login details for example)
A: Check out the official PG wiki on it: https://github.com/phonegap/phonegap/wiki/Platform-Security
Q: is it possable to setup build server in my local? if yes what is the procedure??
A: Not the official PG Build one. But, yuo have some options for automation. THere are command line programs to build stuff, and if you want to automate it, you could use something like ANT along with a Jenkins CI type system. Let me know if that doesn't make sense.
Q: What's technical roadmap? Plugins, and what more?
A: The Cordova roadmap is avilable here: http://wiki.apache.org/cordova/RoadmapProjects An over-simplified answer is that all of the PhoneGap features are becoming plugins, so you will be able to pick and choose what you want in your application, but the major architecutre will remain the same.
Q: I have had a lot of issues trying to connect the Android emulator to sites I have running locally (using windows 7). They are either really slow or cannot connect. I don't think Mac's have this issue. Is there anything you can sugggest?
A: Most likely you are trying to do something like this on your Android emulator. "http://localhost/test.html" - That won't work because on the device (and the sim), localhost is the device itself. In order to hit something on your actual machine, you will need to use the IP address. Your device should be able to hit that. I'll also point out that the Android emulator is a bit sluggish in general. If you Google for that you can find some tips on speeding it up. Frankly, I rarely use it and make use of the iOS Sim a lot more.
Q: I'm interested in creating an app to collect data to ultimately go into a geodatabase (i.e. a database that includes fields for latitude and longitude values). It is not clear to me from what I've read so far how to get the information collected and stored locally on a device using the Storage API into a database on a remote server. The database I want to load information into ultimately is ESRI's file geodatabase format. Any recommendations on where I can learn how to get the information stored locally on the device into my remote database? (Even if I can get the info into a remote SQL database that would be a help.)
A: The local storage API in phonegap is exactly that, just an option to store data locally on the device. To get data into a remote database, you must access a web service. Basically, the phonegap app will make a request to the server (most often these are REST services), and the server will parse the data and push it into a database. In your case, this will be the ESRI database. ESRI has REST APIs in their server products, which you can take advantage of. You could build remote services in C#, Java, PHP, Ruby, or any other language to communicate with the database layer.
Q: In iOS6 some changes broke html5 storage, because of iCloud thingy, how does Phonegap take care that data (persisted or stored) is not lost or deleted by iOS?
A: Long story short, the engineeers fixed it. :) Honestly I don't know their technical way of doing it, but, for you usage of it, you don't have to worry about it. (To be clear, this was fixed post 2.0.0, but if you are on latest you are definitely fine.)
Q: The have been looking and the Megalist plugin the list that i'd want to display isn't static. Does the Megalist allow for items to be added on the fly? If not that's okay. Thanks
A: Do you mean this jQuery plugin? http://www.tricedesigns.com/2012/06/27/megalist-jquery-plugin/ If so, look at the Twitter example. It pulls remote data and renders it asynchronously.
Q: When a user receives an email (on mobile), is it possible to direct them to the app they have installed when selecting a link in the email?
A: Most likely you want to look at the Intents feature. It allows you to register stuff like, "When a user clicks this type of link, do my app." I know that is a bit vague. I've got a blog entry on it that may help. http://www.raymondcamden.com/index.cfm/2012/5/1/Example-of-Intents-with-PhoneGap
Q: To searchtool's follow up question Safari - it is a feature in iOS6. I don't have a good link handy, but I plan on blogging on it soon.
Q: when you use phonegap to develop apps, what do you use? i mean which javascript mobile framework, for transitions between pages for example?
A: You can use pretty much any framework that you want. We try not to be prescriptive on this subject b/c there are so many options, and developers come from a variety of backgrounds, so different frameworks appeal to different types of developers. If you view our blogs, you can see which ones we like to use, but that does not mean they are the only options. Designers will have different preferences than developers. JavaScript experts will have different preferences that JS newcomers, so it is very subjective.
Q: Trying to build an app that holds data locally and sync to a backend server (php/MySQL, not sure yet). Am I in the right direction to utilitization to usd localstorage and cache manifest for offline storage?
A: No. THose are not appriopriate for 'ad hoc' data. Localstorage works great to store simple preferences. Like: favcolor=red. But for ad hoc user generated data you want something more powerful, like the WebSQL API (see the Storage part in the PG docs).
Q: I love the way Simon McDonald and Shazron write a post for each phonegap upgrade. It is immensely useful now that I have to update almost every month. I find the blackberry upgrade guides and upgrade posts lacking these days...is that temporary? Or may be I'm missing some resources
A: There is a blackberry upgrade guide by blackberry, available here: http://devblog.blackberry.com/2012/11/phonegap-blackberry-10/ However, its up to contributors to create this content.
Q: Will a listener for a home button event ever be added to PhoneGap?
A: This is an OS-level event, not one available within a PhoneGap application. However, you can use the "pause" event, which is triggered when the app goes into the background.
Q: Would you have any good recources/examples using phonegap with Requirejs? I've seen some older examples but most of them import phonegap in index.html before requirejs is loaded.
A: It should just work. I haven't used it in PG, but Andy has. If you have a specific example of it failing, please drop us a line (we'll share contact info at the end).
Q: how do you solve android screens resolutions? except fluid design ... will there be a better support for this? for example zooming of the webview
A: I'd need a bit more clarification. Obviously testing helps (look at Edge Inspect for a great way to test your mobile html on N devices). Fluid design *really* should be your main answer here though. If you want to disable zooming in general, that can be done with META viewport tags (ping later for a code sample).
Q: can you show us an example that show how to open a link via inappbrowser with the HTML tag <a ....> link </ a>
A: (from @RandyMcMillan): function helpButton(){ console.log('take a break!'); window.open('http://www.youtube.com/watch?v=wugY6HNLOCo&autoplay=1', '_blank', 'location=yes'); }
Q: Will PhoneGap allow us to create applications for Windows 8?
A: Yes, it is available in the current release of PhoneGap, available on http://www.phonegap.com
Q: There are some way to use saved user credentials to perform authentication calls to the server for retrieve on-line data?
A: Well, keep in mind a PG app is - basically - a web page. If you put a value into a JavaScript variable, it will stay there as long as you don't load another page. If you want to really store stuff, PG offers multiple ways. LocalStorage, WebSQL, even file system.
Q: do you plan to use quicker javascript engine on iOS? somewhere i have read an article about this .. is it true?
A: This is controlled by Apple. We would love to use the Nitro engine, but it will not be accessible until Apple enables it for web views.
Q: I am just getting started with designing a Mobile App with Html,Css,Js via PhoneGap and my first goal is to ensure that all the content fits perfectly on any given phone. So I wanna ask you guys if my approach is correct, and how should I implement it.My idea is to take the device Width and Heigh via JavaScript, I think there are some PhoneGap functions that return these values. Then I'll use this values to set the html Width and Heigh(I think I should do this via onBodyLoad() function, correct me if wrong), this way I set up the html body to the device screen size, and then I position all the other elements via % instead of pixels.
A: You can access the viewport width/height entirely in JavaScript, and set things programmatically, using % sizing inside of that. You could also use CSS absolute positioning of the top-level DOM elements to achieve the same thing.
Q: I'd be interested in whether PG will integrate the best of KirinJS ? Mostly making it very easy to write 2 way phonegap Apis (to and from web view) that have typed interfaces in native.
A: I can't speak for what the PG team will do. However - their philosophy is to _not_ add stuff they don't need. They want to follow web standards as closely as possible and let developers choose which JS libraries make sense for their apps.
Q: do you plan to use quicker javascript engine on iOS? somewhere i have read an article about this .. is it true?
A: As far as I know, we don't have any control over that. It is not something we can tweak. (I'm not 100% confident on that.)
Q: in android touch response time is less than native app ; is there way to impore touch respnse time ?
A: For the fastest touch response time, use touch events (touchstart, touchend) instead of mouse events (click, mousedown, mouseup). On all platforms, mouse events have latency introduced at the OS layer (used to determine if its just a tap vs a gesture), touch events do not have this latency.
Q: Sometimes, some SDK or others ask us to add some lines in the objective-C, like Facebook for "Mobile App Install Ads" they ask to add "[FBSettings publishInstall:YOUR_APP_ID]" in UIApplicationDelegate applicationDidBecomeActive selector - but with phonegap project, we have not this method, so is there a equivalent in the code generated by phonegap?
A: If you are developing locally using Xcode, you can access this method in the application delegate class. This is not available inside of the PhoneGap Build service.
Q: Are there any tips you have for using the File API when not having a SD Card installed? We had a lot of issues not being able storing files locally when not having a SD Card.
A: I've worked with the FileSystem API a bit and normally it just plain works, even w/o a SD card. I hate to punt on this but could you follow up with me via email (this is Ray, will share contact info) to try to hash it out?
Q: HTML5 Android apps crashes when pressing the back button while a textbox is in focus. Is it a problem in phonegap or is it a bug in android? Has anyone encountered this issue?
A: This is an android issue.
===========================
Hey folks - we are wrapping up now. Sorry we couldn't get to every single question. Here are some things you guys should know.
1) Yes, we will post transcripts of the questions and answers. It will be on our blogs (contact info in a sec) and on the TechLive site. Should be in about 2 hours (lunch time for both Andy and I. )
2) If you want to contact us with specific questions, or hit our blogs for the transcripts, here is our contact info:
Andy Trice
http://www.tricedesigns.com
@andytrice
Raymond Camden
http://www.raymondcamden.com
@cfjedimaster
3) For future questions, you can ping us on twitter, or, both of our blogs have a way to contact us.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment