Undesrscore.js library is not working with Ionic based MobileFirst project - ionic-framework

I have created hybrid application with mobilefirst using ionic. I have included underscore.js library in my project. When I try to access methods of underscore, I get errors like underscore is not defined

If you mean that you have created an app using MobileFirst Studio - that is not the recommended path. The recommended path is to create a Cordova application using the MobileFirst CLI. You can then combine this with Ionic. This approach is more fool-proof.
You can follow these guides:
https://www.raymondcamden.com/2015/03/23/working-with-ibm-mobilefirst-and-the-ionic-framework/
https://mobilefirstplatform.ibmcloud.com/blog/2016/01/13/ionic-hybrid-mobile-app-using-mobilefirst-platform-7-1-cli/
Note that you did not mention the actual error you have received. Without this, the question is moot as there can be a number of possibilities. Please actually mention the error you got.

Related

IBM Bluemix - Kitura Swift - is missing a required environment variable: 'OPENAPI_SPEC'

I am stuck for the moment. I cannot obtain the source code for the mobile project and I do not know where is the problem. All my researches was without positive result.
My intention with IBM Bluemix is to develop myself a small project only in Swift (server side + iOS) because I am iOS mobile developer.
When I try to get the code for mobile project (iOS) I get these error:
Error Notification:
The Cloud Foundry App 'XXX' is missing a required environment variable: 'OPENAPI_SPEC'.
I want to use OpenWhisk SDK for iOS. I do not know where to set the variable OPENAPI_SPEC and what value to put in it.
I have setup a Cloud Foundry App started from "Runtime for Swift - Kitura" and a mobile project named started from "Code Starter - OpenWhisk".
Can you help me with some advice or some sample?
Thank you!
If you added a Swift server side Compute to your mobile project, you will need to add an environment variable called OPENAPI_SPEC to your backend to point to a valid Open API swagger document outlining the API.
This way when you download the project, it will auto-generate an SDK corresponding with your backend's Open API.
For instance, here is how you set the environment variable:
And here is a valid API doc that it's using (albeit not in the most elegant Open API compliant format yet but it works).
https://updatesdk.mybluemix.net/explorer/swagger.json
The idea is that the "project" concept takes an abstracted view of a Compute runtime (Cloud Foundry, Docker, etc.) and only cares that it exposes an API compliant with the Open API specification. Using that defined Open API spec, you can dynamically generate an SDK for a "project" when it's downloaded (for iOS, Android, etc.).
If your backend Compute exposes no Open API specification at this time, and you just want to download the code of OpenWhisk for iOS, you can just deassociate that backend Compute from your mobile project for now, and it should download the code. If you ever build on top of that backend and want to reconnect it in the future, you can add it and redownload at a later time (doing a git diff or using the Bluemix CLI SDK plugin to download an SDK from your Open API specification later in your project's lifecycle).

How to create a UWP Package that`s shipping Microsoft.NET.CoreRuntime.1.0 with it

I`m struggling with the following issue:
I try to deploy my uwp app with a Mobile Device Management System (MobileIron). it's only accepts .appxbundle, no .appxupload files. When i try to install/deploy the app on a device, i get the error
Can not install package XY because the package xy has a dependency to Microsoft.NET.CoreRuntime.1.0. This package is needed for the installation. Deploy this Framework together with your package
(my custom translation ;) )
The problem is, I dont know how to create a package, that's shipping the needed CoreRuntime within. When i create a DEBUG Package, i get a appxbundle and a folder with the missing CoreRuntime.appx, but only the powershell script is shipping the CoreRuntime Framework to the Device, not the bundle itself.
When i create a RELEASE Package, it`s running agains .NET Native, in this case i have no CoreRuntime...
Hope i explained my problem good enought and someone can help me or give me a hind.
You need to enable .NET Native, From your Project Properties:
Make sure that your configuration is for Release. And check
Compile with .NET Native tool chain
and
Optimize code
finally make sure to create your packages from Store->Create App Packages. With the following configurations:

Ionic + IBM MobileFirst

I've found a few post on this topic but have not been able to find the best solution.
Attempted to integrate Ionic into IBM MobileFirst (Worklight).
At the moment - I have built a normal Ionic project and moved the WWW folder in the 'common' folder. Also added in the initOptions, main.js and messages.js.
MobileFirst has an awful build process - I hate having to deploy to a mobilefirst development server + preview app for any code changes. I am hoping to get some type of auto reload working within mobileFirst, or at least develop with ionic normally and hav ea job to bring my changes into my worklight project... something that is better than me current situation.
Does anyone have a sample project that actually auto-builds or picks up code changes automatically?
Any and all help is greatly appreciated.
Not sure what do you mean by "auto-reloading"; if you make any changes to the web resources to your project inside the Studio plug-in (in Eclipse) and reload the preview in the browser, it will show the changes.
You are not required to Run As > Run on MobileFirst Development Server for each change. As long as you work on the resources in your workspace, the "auto-reloading" as you call it, should work (make sure you are using the latest available MobileFirst Studio version from the Eclipse Marketplace).
There is also a rudimentary Starter Application that is based on Ionic.
You can download it from here.
There are also several results on the subject matter when searching in Google.
The need to rebuild in order to see changes in your Web components (CSS, JavaScript, HTML) did used to be an annoyance in early versions of what was then Worklight and is now MobileFirst. I forget when the need for a rebuild was removed but certainly in Worklight 6.2 and beyond you now simply need to refresh in your browser.
UPDATE: If using MobileFirst 6.3 you need to ensure that you are on a
suitable patch level. I find that simple refresh does not work in
6.3.0.00-20150106-1717, but if I update (Help->Check for Updates) to 6.3.0.00-20150214-1702 then edit/save/refresh works as
expected.
My personal practice is always to have Mobile Web environment in my project and then choose that from the Console. This loads the application in the browser-based Mobile Simulator that you can tailor to fit your target form-factor. This has a "Go/Refresh" button that immediately reflects your edits.
Alternatively, some folks these days do not use Studio, instead they use the Command Line Interfacer. Possibly this may be more to your taste. You can download it here.
there is a solution with using staff like ionic-cli serve command + symbolic links that will replace common folder.
check here an example https://www.dropbox.com/s/4pvaulo6yo47kb9/lab_7.2.mp4?dl=0
(you just can disable sound, cause i've recorded it in russian) 7-15 minutes of this video
Other option is to organize live-preview yourself using IDE features and/or nodejs
This will work as long as you are working on front-end (mostly non-worklight api) part.
You need to include this lines in the index.html
<!-- ionic bundle & css -->
<link href="www/ionic/css/ionic.css" rel="stylesheet">
<script src="www/ionic/js/ionic.bundle.js"></script>

Unable to select the golang sdk in Intellij IDE

I am following the following blog to configure my golang environment (OS-X machine):
http://webapp.org.ua/dev/intellij-idea-and-go-plugin/
But, whenever I try to add go sdk (installed at /usr/local/go), it appear blank selection for the SDK.
Please suggest me, if I am missing something.
This page lists the SDKs which have already been configured in IntelliJ IDEA. You need to press the "Configure..." button and point the plugin to your SDK installation. Once you do this, it will become available in the SDK list for new project creation.
I would suggest to use the following for writing golang application:
https://groups.google.com/forum/#!msg/golang-nuts/tuGS99f-kqk/Tl5KqNG0js0J
https://github.com/visualfc/liteide
If you want to use IDEA with golang, we've made a lot of progress in the past months. Please install the latest release from github releases and give it a try.
As the name suggests, there are a few issues here and there but it should work much better that the current release of the plugin.
You'll find it a class over the other offerings for writing go apps ;) (disclaimer I'm one of the contributors to the plugin, I'm very biased)

Create GAE eclipse project

I have installed Eclipse Java EE Luna Release (4.4.0) and App Engine SDK 1.9.10
I have created a new Google - Web Application Project and selected the Generate Project Sample Code option. I changed nothing about the project.
The generated project successfully deploys and runs locally. However when I deploy this to AppSpot I get an error message "Remote Procedure Call - Failure" when clicking on the "Send" button on the sample form.
Are there other steps I need to perform in order for the generated project to be successfully deployed to AppSpot?
My goal is to have a starting application that deploys so I can start learning to use Objectify and GWT to build applications. If there is a better way to go about this please suggest it.
Kind regards
Sean
I think seem to remember that sample code for the GWT builds a RPC-based HelloWorld or greeting example. In the auto-generated sample interface you type a name, a RPC call is made to server side and you get "Hello"+yourName or similar as a callback.
Check this link:
http://www.gwtproject.org/doc/latest/tutorial/appengine.html
This is a more advanced app, StockWatcher, from the GWT tutorials which is also RPC based and adapted for the GAE. You could start here: http://www.gwtproject.org/doc/latest/tutorial/gettingstarted.html to build this app (is really easy) and follow to the link above to deploy StockWatcher on the GAE, or check directly the steps on the first link and try to deploy the GWT "Greetings" example.
If you have already tried this or you do and there's still a problem, please provide the full stack trace, or the code you think might be causing the problem, so we have a better insight of the problem.