Can we do some local database (Rhom) operation using javascript in Rhodes - rhomobile

I usually manipulate the Rhom records in the controller using the create, new, update_attributes methods.
But i wonder is there any way we can achieve these features through javascript, as we do in other framework like phonegap ?

I guess no. Previously, Rhomobile had the support for Javascript. But i guess, on the current version they had withdrawn the support.

You can write a complete application just using JavaScript in the next release of the RhoMobile Suite (v4.0).
If you take a look at the new documentation, and you try the latest public beta, you will see that the ORM API are now available from JavaScript.

Related

TypeScript in MVC

Im bulding a website using MVC4. Recently I've read about TypeScript. It looks really nice however I cannot find any use for it in a MVC website. Am I missing something? Do you use it? Where?
TypeScript is a pre-compiler for JavaScript. Hence you can use TypeScript only as a replacement for JavaScript (server-side, e.g. Node.js, or client-side, i.e. in the browser).
As you are probably writing MVC4 code with C#, TypeScript will be of no use for you in relation to MVC4.
Regarding the client-side it's somewhat different.
I guess the main point you need to know is that TypeScript is not (yet) just another language on the server, that you can exchange with C#.
I find it quite useful for building largish apps with lots of logic on the client. The interfaces help avoid some errors. It compiles to javascript so you could use it instead of javascript. If you're just writing a couple of lines I wouldn't bother though.
You can link to the generated javascript files from TS files directly in the script bundles or HTML. If you want to automatically link to many JS files, use require JS. This will save you having to link to many js files.

Convert jquery mobile mvc4 web application to phonegap

I've created one Jquery mobile mvc4 web application using webapi support, which is well looking site in almost all mobile device as well. but now i want to convert this MVC application to phonegap to use mobile feature supports like camera,accelerometer,sound etc..
What is the best way to start converting it to phonegap, will i need to create SOAP based web-Service for webapi code. I've searched on web regarding that but not getting enough help,support.
am i going right way ? or need something else ?
any help is appreciable.
Okay so in order to convert it first you are going to have to know Objective-C because that is the only language that is allowed on the iPhone but assuming you know that here are the steps you can take in making a conversion like that.
*Make sure that any outside information the application retrieves is either a) In a REST api you can use the new WebApi in fact I am using it right now and it works like a charm. Or b) Any script src= tags are converted to local files on disk. So if you had script src="My awesome css" make that file a local file on the phone.
*Next take any views and decide where all of their API calling code is. Make not of that and then get ready to be moving that code.
*Once that is all recorded startup a phonegap project and get rid of any extra .index files or anything you don't need.
*Create your applications PhoneGap plugin. Have the OBjective-C plugin make any API calls that you will be needing and then make the javascript plugin match the objective-C function.
*Where you had any calls in your previous views, make those now call the cordova (PhoneGap) plugin.
This is a very brief roadmap to get started.
Once the tediousness is over it is worth it though. I moved my IOS application to Android and they transfer pretty easy.
Cheers

Using Phonegap as a native container for a Rails 3 App

I'm looking into using PhoneGap for an iOS app so that I can utilize the camera API. The plan is to use Rails to manage the entire experience. At this point, I'm not particularly concerned about performance. If it wasn't for the need for the camera, I would simply design it as a true web app.
Most of the answers and tutorials I have found suggest using ajax to the backend server to render the frontend. At this point in the app development, I'm not sure I want to build so much of the view in JS and would prefer to use Rails to render the views. I have seen a few very brief references to use PhoneGap as a container to literally render the Rails app. Performance aside, is this possible and how would I set up the core html file in PhoneGap to let the mobile app run normally?
I do not believe such a container exists to run on the client side but it is possible to dynamically serve a PhoneGap app (i.e. the app acts as a web browser with native functionality available via javascript commands).
Here is code which demonstrate exactly what you are describing.
Here is a screen cast I did associated with demo.
NOTE: The demo is using an out 3.2.1, and is broken as of the latest version Xcode and/or PhoneGap but it is possible, and apps of this nature are valid in the the various app stores, (Linkedin alongwith many others are already doing it.) The logic is there I just haven't had the time to fix the bug with the new version of Xcode, or update the PhoneGap code (doing the update may actually fix the bug in one quick work session).
Maybe you can also check my example app that is exported to Phoengap. It doesn't use camera but it is possible to combine native parts with Phonegap.
https://github.com/joscas/base_app/tree/devel (currently in the devel branch for the exportable version)
Life deploy: https://starter-app-staging.herokuapp.com (the desktop version)
It is based on rails / ember.js plus with token authentication (ember-auth) + OAuth (Google, LinkedIn,..) and Devise.
It uses the (phonegap-rails) gem I've created to export assets, fix paths etc.

What JavaScript framework do you use with trigger.io? (backbone, knockout, ember, angular)

What JavaScript framework do you use successfully with Trigger.io? I mean client side JS app frameworks like backbone, knockout, ember, angular?
We use angular.js here but have some significant problems when using router for our app ... see details here https://groups.google.com/forum/?fromgroups#!topic/angular/XGDRAskA8qs .
Trigger.io and using angular.js router doesnt work together.(at least we could not get it to work)
Do you use some other JS framework you can recommend as working fine with trigger.io using application router capability? (I could see similar router feature in ember or backbone for example)
Although we don't endorse one particular library, and our goal is to be compatible with them all, I normally reach for Backbone first when starting a Trigger app. It's simple, lightweight but powerful and has a bunch of nice extensions.
Apart from the issues with Angular which we aim to have fixed as part of our next major release (probably end of July '12), we've not had reports of any snags with other libraries apart from Amber Smalltalk, which should be fixed in the same release.
We have demo apps using Backbone and Sencha here and here, and our initial demo app is written using jQuery Mobile.
I'm using jQuery, Backbonejs, Handlebars, Coffeescript, LESS as my framework - they are pretty much all from my Web development effort. Didn't have to change too much.
In fact, so far, I'm finding I have to simplify a LOT of things to get it down to a level where it fits the mobile environment.
Angular JS is one of the best contenders out there as far as JavaScript Frameworks. I ran all the way through the Angular tutorial, created a new Trigger app, and dropped in the tutorial app in place of the default scaffolding.
RAN NO PROBLEM WHAT SO EVER!!! IOS, Android, and WEB
Interestingly enough, I adapted the Angular tutorial with my own data from a server. Even works using XHR requests, and Cross Origin Resource Sharing.
In my opinion, build your app using Angular.JS + Zepto/Jquery.
Use either of those frameworks to add CSS Transitions to your app for your UI.
The reason I recommend making your own UI rather than using something like JQuery Mobile, or Sencha Touch 2 is for the past 3 days I have been doing extensive research and testing on numerouse JS Mobile UI Frameworks, and JQmobi is the only one that came close to being fast but it didnt look vary nice.
Making your own will reduce size of the app, give you full control, and keep the app running smooth..your using will never know its not native ;P

How to display an ASP.net MVC project version in page?

In WinForms, I'd use Application.ProductVersion.
I've tried using System.Reflection.Assembly in various ways but can never get the version of just the MVC project.
Provided this code is explicitly in the MVC project (rather than in a helper assembly), you should be able to use System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(3), which returns the major, minor, and revision numbers. Otherwise you might want to use something like typeof(HomeController).Assembly.GetName().Version.ToString(3).

Resources