how to implement SQLite in sencha touch? - sencha-touch

Please any one know how to implement sqlite database in sencha touch. I want to save data in local database not in local storage.
thanks in advance.

Sencha actually has it's own sql proxy since 2.1.
If your app isn't native, you won't be able to use sqlite, only websql which is subject to the 5mb local storage limit.
If your app is native, you will need to use phonegap with the Sencha sql proxy and a sqlite proxy. I fully recommend this as it works perfectly for me across both Android and iOS.
Here's a link to the cordova/phonegap plugin which is fully compatible with plugman:
https://github.com/lite4cordova/Cordova-SQLitePlugin
Here's a couple of posts on my blog you might find useful with regards to sqlite/websql and Sencha Touch:
Fix to proxy to deal with arrays/objects fields: http://senchatouchdev.com/wordpress/2013/11/20/sqlite-fix-for-arrayobject-fields/
Difference between sqlite/websql and sencha touch:
http://senchatouchdev.com/wordpress/2013/04/19/sencha-touch-clarifying-websql-sqlite-and-how-they-relate-to-sencha-touch/

There two way to do that:
Use a sqlLite Sencha Proxy (not existing by default sencha touch) with the help of tomalex0 sqlLite proxy.
or, if you intend to deploy your application on smartphones as a native application:
Use Sencha touch with PhoneGap API to Access the native database of the phone (needs some native programming) witch not very recommended.

Related

React native, do I need to send updates through app store?

Title pretty much explains it. Does it render JS from an external codebase so I can simply push new updates through git, or do I need to actually push the changes through App Store?
This is my previous answer, which is getting downvoted into oblivion because it didn't predict something cool like CodePush coming to React Native :)
React Native compiles to an iOS binary. Updates need to be sent to the
App Store, unless you're simply using React Native for its WebView
and rendering an existing webpage on the client.
Updated 6/2/16
It looks like Microsoft has a sweet plugin for CodePush found here that lets you push changes remotely to your React Native app without having to send the update through the App Store.
Here's a quote from the README docs:
NOTE: While Apple's developer agreement fully allows performing
over-the-air updates of JavaScript and assets (which is what enables
CodePush!), it is against their policy for an app to display an update
prompt. Because of this, we recommend that App Store-distributed apps
don't enable the updateDialog option when calling sync, whereas Google
Play and internally distributed apps (e.g. Enterprise, Fabric,
HockeyApp) can choose to enable/customize it.
I'm actually working on a project (with the React Native Playground team - https://rnplay.org/about) that will allow you do live update your apps JS on the fly without submitting an update to the App Store. It's called Reploy, http://reploy.io
We will be open-sourcing the first portion of it very soon (the updater module). There will also be a service that will help you to manage your updates and even deploy your app to TestFlight and the App Store when needed (App Store updates are still needed when adding a new native module or static assets).
Also, just so you know, Apple has allowed this type of auto-updating via item 3.3.2 in the "iOS Developer Program Requirements" document, it says:
3.3.2 An Application may not download or install executable code. Interpreted
code may only be used in an Application if all scripts, code and interpreters are
packaged in the Application and not downloaded. The only exception to the
foregoing is scripts and code downloaded and run by Apple's built-in WebKit
framework or JavascriptCore, provided that such scripts and code do not change
the primary purpose of the Application by providing features or functionality that are
inconsistent with the intended and advertised purpose of the Application as
submitted to the App Store.
https://developer.apple.com/programs/ios/information/iOS_Program_Information_4_3_15.pdf
You could push an update to a remote user if you had linked to an external bundle and had the IP / correct ports forwarded, however Apple do not allow this for released AppStore apps.
For beta testing remote apps you might want to try exponent http://exp.host/
Update---
For completeness, it should be noted that if you are part of the Apple Enterprise program you do not need to publish Apps to the AppStore at all, you can post them to end users via a download link.
I work on a project called AppHub that lets you update JavaScript and images without re-submitting to the App Store. The iOS SDK will be open source, but for now you can use the hosted service to manage new builds of your app.

WL.EncryptedCache in Worklight

WL.EncryptedCache in Worklight.
Can WL.EncryptedCache be created for different worklight application ?
If so how many Encrypted boxes it can create for a single device ?
If no y it cant create ?
This Question arrised because the worklight makes of use of Webstorage of HTML for EncryptedCache.
Yes. EncryptedCache uses the HTML5 local storage to store the data. In iOS it is app level and you can find the cached resources in Library/Caches/yourBundleId/ ApplicationCache.db
Depends on your number of apps. each apps has its own size. Once it is reached the level you will get javascript errors
You can create more than one EncryptedCache in a single device again it is for per application
The cache is created per application, so if you have 2 Worklight applications that in both of them you use WL.EncryptedCache then each app will have its own cache.
This is because every app is sandboxed and do not share the cache of another app.
This is not related to Worklight, but to the way the device works be it Android or iOS, etc.

How to upload a photo image using Sencha Touch without phonegap

Is it possible to upload an image created by the phone using Sencha Touch but without any dependency on PhoneGap? Basically my app will be accessible via the web, and not installed natively on the device. I want to be able to select an image from the phone storage and then be able to upload it to the service. I effectively want the same functionality as you would get with the file upload control on a normal desktop browser.
Is this possible, and if so how?
There is a current solution in its infancy, but it works. I tested it on my Nexus 7 using Chrome. Here is the list of compatibility:
Android (4.0 up) browser support as regular
Google Chrome for desktop and mobile
iOS Safari browser support from version 6.0 (not tested on mobile)
https://github.com/kostysh/File-uploading-component-for-Sencha-Touch
Desktop webbrowser and mobile browser are different in lot many cases. To access file upload option you need to access the OS API which is not possible using javascript only. Phonegap provides us option to connect js with device API. If you can find a way to do this, without using Phonegap, then may be you can fix, or else its not possible.

Client-server mobile app. Where to begin for the server side?

I have to create an iPhone app which displays some sentences.
I would to download these sentences from a server and save them in a local db (for example using JSON).
The user can flag a sentence as favorite and do some other stuff.
I would to give the possibility to download other sentences, updating the corresponding table in the local db.
I don't know where to begin to build the server side.
Try to use Node.js its quite easy to use but do it in combination of ExpressJS... This is necessary to create the server side. You can even use some PHP framework if you prefer this...
Next you can choose between HTML5 or native programming for client side... It's up to you with which one you are more familiar... I think in your case you can create an HTML5 app to get the result as you need it... But of course its even possible native on the phone it just may take longer depending on your experience
So to sum up:
NODEJS + ExpressJS plugin
Phonegap (if you want to use html5 to create your app) or Native SDK (like iOS sdk or Android SDK or Windows mobile SDK)

Making a sencha touch app work offline?

I've tried using the download from the sencha website
http://www.sencha.com/learn/Tutorial:Taking_Sencha_Touch_Apps_Offline
when uploaded to my server and viewed on my ipad offline the app just says you need to be connected to the internet or words to that effect. Any ideas how to fix this or does anybody have a working offline example?
Not strictly related to the point, but you could take a look at PhoneGap (http://www.phonegap.com/) if you're looking for a more complete offline solution, at the price of a higher complexity and app store issues.
I found it quite well done and it offers a greater flexibility wrt offline storage and native access.