Giter Club home page Giter Club logo

cordova-samples's Introduction

Visual Studio Tools for Apache Cordova - Sample Apps

Visual Studio Tools for Apache Cordova combines the goodness of your favorite IDE with the ease of creating apps for multiple mobile operating systems, all in a simple to use workflow. One of the major pain points for our enterprise developers is the effort required to build apps for multiple platforms, while keeping costs and effort down. Visual Studio Tools for Apache Cordova allows developers to use HTML5 and JavaScript, along with their favorite open source framework libraries to build web applications.

Leveraging the Apache Cordova framework, we create packaged mobile apps that feel and behave like native device applications. What's great is that all this can be done completely from within Visual Studio, with full tooling support for building, debugging and packaging that our customers love. Our highlight features include attaching and debugging to the Android emulator and devices, plus, being able to build and simulate remotely for the iOS platform.

This repository contains a number of Sample Apps that you can download and view.

Note that you may also find tutorials available in our cordova-docs repository of additional interest.

Terms of Use

By downloading and running this project, you agree to the license terms of the third party application software, Microsoft products, and components to be installed.

The third party software and products are provided to you by third parties. You are responsible for reading and accepting the relevant license terms for all software that will be installed. Microsoft grants you no rights to third party software.

License

Unless otherwise mentioned, the samples are released under the MIT license.

The MIT License (MIT)

Copyright (c) Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Help us improve our samples

Help us improve out samples by sending us a pull-request or opening a GitHub Issue

More Information

cordova-samples's People

Contributors

anbucyk avatar capfei avatar chuxel avatar cloudcolonel avatar cpsloal avatar eduardon avatar ggailey777 avatar jmatthiesen avatar johnwargo avatar ljzhong avatar mikejo5000 avatar mikejo5001 avatar normesta avatar rido-min avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-samples's Issues

Request for Cordova + Elm example project

Elm (elm-lang.org/) is an excellent language for writing web apps. It focuses on speed and functional programming. I am a beginner to both cordova and elm, but I their focus on the virtual dom could benefit greatly when creating native Android and IOS apps. Supposedly, it is already much faster than angularjs

There are a few sparse examples around github.com/johnpmayer/cordova-hello (from this discussion), but it would be nice to see one built from the source, with best practices in mind.

WeatherAppIonic2 for VS 2015 is throwing error as not recognizing working directory as a Cordova-based project

Error BLD105 The Cordova build did not recognize your working directory as a Cordova-based project. This is often because the "www" directory is not at the root of your project.

FYI
I am using VS 2015
Installed these dependencies

  1. NPM task runner
  2. TypeScript 2.0.6 editor
  3. Microsoft ASP.NET and Web Tools Preview 2

However restoring packages did not work , so I had to run npm install from command prompt.
Now its showing no error on dependencies.

Cannot get signalr to work.

Hi

I am trying to connect to a signalr self hosted application.
I have tested the html code and all works fine in a browser.

I am getting this message in the ripple emulator :
Error during start request. Stopping the connection.
HTTP Response message is :
The ConnectionId is in the incorrect format.

Please review the github repository i created for this issue.
https://github.com/christophedemey/apachecordovasignalrfail

Thanks!

referencing errors

I copied the project solution code for the todo app into project folder for VS2015 which has the cordova tools installed etc ... the project builds without errors but there are runtime errors (running in the default ripple emulator ) ...

scripts/frameworks/angular.min.js .... but the frameworks folder is not in the project???

also the config.xml was not found even though it is in the project

Put Hosted-Web-App back in main repo release/master branch?

It appears that hosted-web-app has been removed from the main repo.
I see that there is a new branch called hosted-app-2017.
The world needs the ability to make hosted web apps simply.
See for instance:
https://stackoverflow.com/questions/48476685/how-to-make-a-simple-cordova-hosted-webapp-that-retrieves-content-from-a-remote
It would be great if you could add this branch back into the main repo (first) and add some documentation to it (second) so that the rest of us can use it.
Meanwhile, going to attempt to use the hosted-app-2017 branch, but not sure what state it's in.
Thanks for your help in creating this repo.

Thanks

Run at windows 10 Error

WinJS Sample

in Visual Studio 2015 RC + Windows 10 (build 10030) run at windows any cpu with local machine , but receive as follow error message

'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/1.0)'.
'WWAHost.exe' (Script): Loaded 'ms-appx://com.microsoft.mdha.samples.winjstodo/www/scripts/frameworks/base.min.js'.
SourceMap C:\project\cordova-samples-master\todo-winjs\WinJsTodo\www\scripts\frameworks\base.min.js.map read failed: Could not find file 'C:\project\cordova-samples-master\todo-winjs\WinJsTodo\www\scripts\frameworks\base.min.js.map'.'WWAHost.exe' (Script): Loaded 'ms-appx://com.microsoft.mdha.samples.winjstodo/www/scripts/frameworks/ui.min.js'.
SourceMap C:\project\cordova-samples-master\todo-winjs\WinJsTodo\www\scripts\frameworks\ui.min.js.map read failed: Could not find file 'C:\project\cordova-samples-master\todo-winjs\WinJsTodo\www\scripts\frameworks\ui.min.js.map'.'WWAHost.exe' (Script): Loaded 'ms-appx://com.microsoft.mdha.samples.winjstodo/www/scripts/appBundle.js'.
The program '[6480] WWAHost.exe' has exited with code 3 (0x3).

Missing CSS Files

Seems like files bootstrap.min.css, font-awesome.min.css, snap.css and app.css are missing in the WeatherAppIonic2 project.

bar code scanner example

Greate repo!

Could you provide a bar code scanner example which will work on Android, iOS and Windows Phone 10, please?

Error when building CordovaHostedWeb

I got this error when trying to build CordovaHostedWeb:

error TS6053: Build:File 'C:/Users/DEV/Downloads/cordova-samples-master/cordova-samples-master/hosted-web-app/completed/CordovaHostedWeb/cordovaApp/typings/cordova/plugins/BatteryStatus.d.ts' not found.

Also not found are Camera.d.ts, Contacts.d.ts and all *.ts file plugins folder.
Can anyone help?

Opposite Operator

Use opposite operator instead of the logic complement operator.

376         }
377         // If not, then display error dialog
378         else {
379             final boolean exit = !(errorCode == WebViewClient.ERROR_HOST_LOOKUP);
380             me.runOnUiThread(new Runnable() {
381                 public void run() {

Why is this an issue?

Use opposite operator instead of negating the whole expression with a logic complement operator. It makes code easier to read and understand.

Ex:

public boolean bar(int a, int b) {

  if (!(a == b)) { // use !=
    return false;
  }

  if (!(a < b)) { // use >=
    return false;
  }

  return true;
}

Source

Related code pattern

Enforces opposite operator instead of negating

Enforces the usage of the opposite operator instead of negating the whole expression with a logic complement operator.

Issue with Windows 8 App - Cordova OAuth2 opening Iframe or Redirect

Hi,

I have been putting some code together with the objective to get the code to to work on all of the visual studio tools device emulators. So far this has been great, the only device that I am struggling to get working is the windows app simulator. So what the application does is its a Facebook Login using hello.js. I have a landing page and a login to Facebook button. When I click on the login button on all the other device simulators / emulators everything works great, I can either open the Facebook request in a popup or in the same screen. When I try this on a windows 8 app however the emulator seems to just loose focus from the app. (maybe trying to launch a browser)

So what I have tried is appending ms-appx:/// to the authorization url, looked something like this:

oauth : {
        version : 2.3,
        auth: 'ms-appx:///https://www.facebook.com/dialog/oauth/',
        grant: 'ms-appx:///https://graph.facebook.com/oauth/access_token'
    },    

What happens now is that the app no longer looses focus but the content is a blank white page.

Any help would be appreciated. Thanks :)

QUnit example is broken

Chrome 67.0.3396 (Mac OS X 10.13.4) ERROR
{
"message": "Uncaught ReferenceError: test is not defined\nat tests/normalize_tests.js:9:1\n\nReferenceError: test is not defined\n at tests/normalize_tests.js:9:1",
"str": "Uncaught ReferenceError: test is not defined\nat tests/normalize_tests.js:9:1\n\nReferenceError: test is not defined\n at tests/normalize_tests.js:9:1"
}

Is there any example code for subscribe notify?

Dear sir:
Is there any example code for subscribe notify?

I use code like below , only got subscribed call back, no any subscribedResult.
Not the device issue, because device work well with LightBlue Explorer
new Promise(function (resolve, reject) {
bluetoothle.subscribe(resolve, reject,
{ address: address, service: serviceUuid, characteristic: characteristic.uuid });

                }).then(subscribeSuccess, handleError);

function subscribeSuccess(result)
{
if (result.status == "subscribedResult") {
alert(result.value);
}
}

Explicit Scoping

Use explicit scoping instead of the default package private level.

34
35 public class Geolocation extends CordovaPlugin {
36
37     String TAG = "GeolocationPlugin";
38     CallbackContext context;
39

Why is this an issue?

Use explicit scoping instead of the default package private level. What this means it that you should do is make all the fields within your classes private to enforce better encapsulation.

Ex:

public class Foo {
    /* private missing */ Object bar;
}

Source

Related code pattern

Enforces the use of explicit scoping

Use explicit scoping instead of the default package private level.

Error to build cordova-plugin-bluetoothle

I got the next error when I'm building the project for android (cordova build android):
Discovered saved plugin "cordova-plugin-bluetoothle ". Adding it to the project
Failed to restore plugin "cordova-plugin-bluetoothle " from config.xml. You might need to try adding it again. Error: Failed to fetch plugin cordova-plugin-bluetoothle @3.1.0 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "cordova-plugin-bluetoothle ": name cannot contain leading or trailing spaces; name can only contain URL-friendly characters

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2019-12-08T22_33_29_391Z-debug.log

Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\user\AppData\Local\Android\Sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app

Task :app:preBuild UP-TO-DATE
Task :CordovaLib:preBuild UP-TO-DATE
Task :CordovaLib:preDebugBuild UP-TO-DATE
Task :CordovaLib:checkDebugManifest UP-TO-DATE
Task :CordovaLib:processDebugManifest UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :CordovaLib:compileDebugAidl NO-SOURCE
Task :app:compileDebugAidl NO-SOURCE
...

update

is there any update of your samples for Visual studio 2017 ?
thank you .

String Comparisons

Position literals first in String comparisons.

42
43     public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
44         context = callbackContext;
45         if(action.equals("getPermission"))
46         {
47             if(hasPermisssion())

Why is this an issue?

Position literals first in comparisons, if the second argument is null then NullPointerExceptions can be avoided, they will just return false.

Ex:

class Foo {
  boolean bar(String x) { //it will throw a nullPointer if x is null
    return x.equals("2");
  }

  boolean bar2(String x) { //this way it will return false even if x is null
    return "2".equals(x);
  }
}

Source

Related code pattern

Enforces literals first in comparisons

Enforces literals to be positioned first in comparisons.

Cordova samples need the Whitelist plugin for XHR requests

It looks like you now need the Whitelist plugin to be able to make remote xhr requests to Mobile Services (or any remote URL), which is what the client does. I submitted a PR with the fix #10, but you probably will need the same fix in other samples that access mobile services or any other remote service using XHR, which is why I also opened this issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.