How to create a PPAPI plugin for Google Chrome in Windows? - google-chrome

I am new to PPAPI development and have downloaded the already examples from here
However, even after coming across the documentation,
I am not able to build the project.
I have Microsoft Visual Studio 2010, Windows OS and Chrome:30.0.1599.65
I understand that once a dll is created, using the regsvr32 command will register the plugin, although getting the dll, even with available code, seems tough for me. Any help for building the dll is appreciated.

You will want to start here to download the and set up the SDK: https://developers.google.com/native-client/sdk/download
This page will take you through how to build and run the examples: https://developer.chrome.com/native-client/sdk/examples
This page goes over how to actually create your own plugin: https://developer.chrome.com/native-client/devguide/tutorial/tutorial-part1
And then you should read this entire section to code and structure your application: https://developer.chrome.com/native-client/devguide/coding/application-structure
If you need any third party libraries be sure to check here: https://chromium.googlesource.com/webports
Edit: Forgot to mention that you will want to use the same version of the pepper api as the version of chrome you're running (in this case pepper_30). Also, you have to use the NaCl toolchain (one of either glibc, newlib, or pnacl); you can't use the Visual C/C++ toolchains. I recommend trying pnacl now that it is available, as that is by far the most cross platform version, but if you run into trouble, you'll probably want to use the newlib toolchain as it has better support.

Related

How do I convert web application into desktop executable?

I've HTML application build with AngularJS/jQuery/Bootstrap with AJAX REST API.
Is it possible to create executable/installer for Windows operating system?
Without any 3rd-party software, it should look like native application, but HTML.
For example, Slack messenger has web/mac/windows versions and they look same.
Any ideas?
// UPD
I probably need a wrapper (webview), but I need all features for EcmaScript5/CSS3.
Electron is the easiest way:
1. Install electron
2. Create and edit main.js:
const electron = require('electron');
const { app, BrowserWindow } = electron;
let mainWindow;
app.on('ready', () => {
mainWindow = new BrowserWindow({
width: 1000,
height: 700
});
mainWindow.setTitle('title of the desktop app');
mainWindow.loadURL('http://www.yourwebpage.com');
mainWindow.on('closed', () => {
mainWindow = null;
});
});
3. Execute desktop app:
electron main.js
And to build the app, use a builder such as electron-builder.
Hope that helps you!
(Full disclosure, I'm the founder of ToDesktop, I'll try to be objective and unbiased here.)
As usual in Computer Science, the answer is "it depends"!
The first question that you should ask yourself is: Who is the desktop app being used by? Just you? Or, are you distributing the app to customers? Because these two segments have very different needs.
Just you
There are a lot of options here (in no particular order):
Nativefier — The obvious option. Lots of configuration options, lots of contributors, open source and regularly updated. This should probably be the default option if you want to whip up an app just for yourself.
WebDGap — This is a lovely project but it is a little old and "as of April 13th, 2018 WebDGap is no longer an active project.". It should also be noted that this is built on an old version of node-webkit and not Electron.
Web2Desk — Great option if you don't want to mess around with the command-line. It uses Nativefier under-the-hood. It is free with a splash screen or $19 with the splash screen removed.
Do-it-yourself with Electron — The basics were covered quite well in this earlier answer. I like this option because it gives you complete flexibility to take the project wherever you like and you'll learn a bit of Electron too.
Fluid App — This is Mac only but otherwise it's a lovely solution and super easy. It's free for the standard version, there is also a $5 version which includes features like fullscreen.
Flotato — Mac only again but this is a really interesting approach. Simply clone the app and give it a name like docs.google.com, it will then turn into Google Docs. At the time of writing this, it's in pre-release (not released yet) but I'll be watching this closely, it's very cool.
ToDesktop — ToDesktop will work but it's probably a bit overkill if you're creating a personal app. Also, it's probably a bit too expensive for this use-case. ToDesktop is targeted at creating a desktop app for distribution to customers (more about that below).
Distributing to customers
There are a few extra considerations which become more important when creating a desktop app for distribution to your customers:
Installer — Mac users expect a "drag to applications" DMG file. Windows users expect an installer and they also expect to be able to uninstall it from the control panel.
Code Signing — If your app isn't code signed then by default Windows Authenticode and Apple Gatekeeper will prevent your desktop app from being opened.
Auto-update — There is still a web browser running "underneath" your desktop app, it's important to keep this updated for two reasons. 1. Security issues + vulnerabilities should be patched over time. 2. You don't want to be stuck supporting an old web browser in 5 years time because your desktop app's browser hasn't been updated
The tools mentioned above don't offer these features, so they're not really suitable for the use-case of distributing your app to customers. These are the features that we wanted to add when building ToDesktop, so I think it fits this use-case quite nicely. We're adding features all the time, last week we added support for App Protocols and Deeplinks.
I myself was looking for an all around solution for awhile. I tried everything from TideSDK, AppJS, Appcelerator Titanium, native code in VB.NET, XCode, Python, C++, Electron, node-webkit, etc: Basically you name it I've tried it.
Note Electron is nice, but it only runs on 64bit processors. So node-webkit is good if you want to run your app on 32bit processors.
So I decided to build my own open source solution called WebDGap.
Currently WebDGap runs on Windows, Linux, Mac OS X, Google Chrome and as a web application!
Watch the How To Video to learn, well how to use the app obviously.
Here's a screenshot.
Being that you're a Mac user already you can merge your exported app into 1 .app mac file. This can be done with Automator (and a little shell scripting).
There's also a coding playground I made for mobile users that has this feature built in called kodeWeave.
Here's a Tic-Tac-Toe game I'm going to export as a Mac App:
Now the web app is running as a native Mac application!
The most easiest and quickest way i know is to use nodejs/npm’s nativefier library which underlying electronjs . It will just take 5 min to create executable for windows. Even a person who do not have programming experience can create desktop application from web application. Below mentioned post has described the steps to convert web application to desktop application. Must read !
Convert any web application to desktop application in 2 min using npm’s nativefier
There are a ton of frameworks out there that can wrap your web app into a native application that can access things like the file storage API for an operating system. This is the specific guide for Windows.
BEWARE THOUGH - you will need to spend time doing solid testing and QA work for your native app so it doesn't feel like a website inside a native wrapper, as well as integrates well with all versions of the OS you want to be compatible with. Tweetdeck for Mac is an example of what not to do - basically a web browser in a native wrapper).
Use Web2Desk: If you are looking for Free and Simple solution.
wherein all you need to do is enter the URL of the web app (or website) and Desktop app for Mac, Windows, and Linux is generated in no time.
With a bit of wrapper code you could package it as a Chrome App. They do not need to run in a browser window but have all the capabilities of a web app, standalone.
https://developer.chrome.com/apps/about_apps
Best Way to Convert Web to Exe is using nativefier:
nativefier --name "Inventory Management System" "http://localhost/php_stock_zip/php_stock_zip/php_stock/" -i ./icon.png -p windows
Steps:
Press Win+x
Press C
Type
nativefier
Installation Requirements
* macOS 10.9+ / Windows / Linux
* Node.js >=6 (4.x may work but is no longer tested, please upgrade)
See optional dependencies for more
Step 5: npm install nativefier -g
Finally type nativefier "Web Link"

Why use Service.Model from Silverlight for WindowsPhone?

I understood Silverlight was drop by MS.
I create my first app permitting to read RSS in WindowsPhone and I need to add a reference to System.ServiceModel.Syndication.dll. In the doc http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh487167(v=vs.105).aspx, I need to find this lib in Microsoft SDKs/Silverlight/v4.0/Libraries/Client/.Why should I do it? Why I can't add directly a lib from the standard .net4?
Can you help me to understand.
[UPDATE]
When I add the lib from C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\Libraries\Client\
Visual Studio shows a windows "Adding reference to Windows Phone XNA assembly is safe. However adding reference to a silverlight assembly may lead to unexpexted application behavior. Do you want to continue.
So my assumption is this lib shoudn't be use but I don't find another way.
Maybe by add a ref from .Net 4 or 4.5.
Best regards,
Alexandre
The Windows Phone 7 SDK was built on top of Silverlight. For Windows Phone 8 this was changed so that there isn't a direct history with Silverlight but it was based on WinRT instead. Lots of functionality was made available to Silverlight controls to support backwards compatibility with apps written for 7.
Because WinRT is not compatible with classes written for the full version of the framework you cannot use these in your Windows Phone apps.
The warning you are getting is just a warning. It's telling you that your doing something that isn't an ideal and so you may have issues. Unfortunately there are no other versions of the SyndicationFeed object available to Windows Phone apps so you'll need to use this library if you want the functionality of SyndicationFeed without recreating it yourself. The good news is that there are no issue with using this class in your app. Just be sure to test carefully, on real devices, if you start to use other functionality from that assembly because, as the warning says: "there may be unexpected behaviour".

Monodevelop, where can I download it?

I was trying to download Monodevelop for mac, but on the official page there is everything but a compiled and downloadable file.
I've read around other threads on different forum and apparently it is required to compile the source code. Is this really the case?
What other alternative may exist for Mac? I just need to dig into some source code, using references and jumping from code portion to others without using the search filter.
Thanks.
If you want a binary for Mac, you need to go to Xamarin's homepage and simply download Xamarin Studio.
Xamarin Studio is basically the same thing as MonoDevelop, the only difference is a bit of branding and the inclusion of 3 plugins for their proprietary development offerings, which you can ignore if you're not interested in developing for the mobile platform.

objective j loads slowly in browsew

I am iOS developer. I know just a couple of languages and I hate html because of the lack of possibilities there.. I've just red about objective-j. When I try to open any code in web browser (last versions of Safari, Google Chrome) it loads increadibly slow..
Is it normal?
How to make it work fast?
Are there any other languages similar to c, objective-c that I can use for creating a web-site?
And another queastion coming with: How can I make Xcode work with objective-j? I use coda 2.0 at the moment.
Make sure you run jake deploy to create the stripped and precompiled version of the app you're testing. Most sample code out there will be run in uncompiled "debug" mode which is great when you're developing but in actual deployment you'll want the precompiled version of your app.
Also, the current development version of Cappuccino and Objective-J is much faster than the last release 0.9.6, thanks to a new, better compiler. Keep an eye out for a future Cappuccino 0.9.7 release.
I think if you write a significant app in Cappuccino you'll find the load time to be absolutely comparable with other large web apps such as Gmail.
Currently you can only use Xcode to edit the user interface of a Cappuccino app. It does not work well to edit Cappuccino code itself since the latest versions of Xcode don't include the necessary plugin framework. You can learn more about good editor options in the development environment tutorial.
I am not familiar with other languages similar to Objective-C for the web, but Intel has an Objective-C to JavaScript compiler here.

Using stl in an Android adb shell native program

I'm trying to port a C++ utility program that I want to be run from the Android ADB shell.
For that, I'm using the Android NDK's make-standalone-toolchain.sh script, and compiling my program with it.
Unfortunately, when I try to run it, I get this error:
reloc_library[1315]: 16304 cannot locate '_ZNKSs5c_strEv'...
CANNOT LINK EXECUTABLE
After some research, I saw that this means that the c_str function doesn't exist in libstdc++.so in the NDK. I also couldn't find the symbol in stlport.so either, and actually only found it in the ./sources/cxx-stl/gnu-libstdc++/libs/ version of the C++ libraries. These libraries are not included in the standalone toolchain I made, and I also couldn't find them on the device (the device is running Honeycomb).
The text in the NDK clearly states that there's support for the entire STL when I use stlport. Is this something that is only true in Ice Cream Sandwich? The libstlport.so or in libsupc++.so on the device and in the NDK didn't have any signature like the one that wasn't found.
So my question has two parts:
Is there something I'm missing in the build process/Android setup? Can I set up things differently so that the program will compile without needing the gnu-libstc++, or at least fail with a compilation/link error instead of failing to load on the device?
If linking with gnu-libstc++ is the only way, how can I do that? I think I can manage statically link to it but I'd rather not.
How can I add the gnu-libstdc++ version to my
If someone else is looking for a solution, I ended up adding a dependency using the -l switch on libgnustl_shared.so. You can find it inside the NDK at
sources/cxx-stl/gnu-libstdc++/libs/&ltarchitecture&gt/
I then pushed this .so together with the program to the device, and made a script that adds the current directory to LD_LIBRARY_PATH. It seems similar to what the NDK does when you use the make scripts to create a program that depends on gnustl.