How to do remote debugging with argon.js and Argon4? - ios

Similar to remote debugging with iOS(using Safari) or Android(using Chrome), I'd like to do the same thing with Argon.

I assume you mean debugging argon.js apps using Argon4, the current version of the iOS app (at http://argonjs.io).
Like other apps that use Apple's built-in WkWebView, you can't use a remote debugger, since Apple won’t allow the remote debugger to work for any app except mobile safari. Which makes sense, since there are lots of technologies for building mobile apps using web tech, and people don’t want folks poking around inside their apps.
When developing a website using argon.js, if you are doing geospatial AR (essentially, anything that doesn't use Vuforia), you can just run the app in mobile Safari and use the remote debugger as you might hope.
My general approach is to developing and debugging with argon.js on Argon4 is:
first pass through, I debug on desktop in Safari or Firefox or Chrome (so I get the desktop debugger of my choice). This helps find many of those annoying little errors and typos. Take a look at some of the samples, such as the Vuforia samples, which re-orient the content to ensure it's visible even when there is no Vuforia running. I did this explicitly to enable me to see the content and debug.
second pass in Argon4 (since I built the app myself during development, I can do remote debugging), but you could use mobile Safari something that's closer to Argon, and still get remote debugging.
finally, I test in Argon4 itself. You can use the console to print things to, look for errors and so forth. Not idea, I know.
FYI you may find http://vorlonjs.com/ is useful for remote debugging an app while running in Argon.

I've been recommended Vorlon.js and jconsole.com for this, any other suggestions/ideas are welcome.

Related

Can you turn only one page into an app in meteor?

I have just tried to run
meteor run ios
That command emulates my application as an app. But there is just one page that would be interesting to have as an app. Can you control this in some way?
I don't think this is possible. The whole app gets exported regardless of platform, hence the universal/isomorphic apps concept. And in the universal app concept is one that I'm starting to find fault in. That said there is a better middle ground.
We'll call it sudo-universal apps. (probably a horrible name, but whatever :D)
Essentially the concept is that you have 3 codebases, for each device (web/ios/andriod) but share many of the same modules via something like npm, or potentially some other way of sharing code.
Then you can focus on the ui for each device and its strengths and weaknesses, but keep all the important logic you've built.
Check out the following:
https://voice.kadira.io/say-no-to-isomorphic-apps-b7b7c419c634#.3bn5ovts1
https://forums.meteor.com/t/say-no-to-universal-apps/16813/7
Hope this helps!
You can check whether the client code is executed on iOS or not, and change the app accordingly:
if(navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
// Disable the links, and redirect to which page you want
}
But Justin's answer is great, a new platform usually needs more than just some tweaks. A quickly developed app has very low value for the user.

Communicate between UIAutomation and app

Is there any way for a UIAutomation script to communicate with the running app and just send it information, trigger a function, or change a variable - directly rather than through the UI?
I ask because I am using just using the script to take screenshots and it would be really handy if I could tell the app to set a couple of integers rather than dealing with somewhat unreliable and difficult to set up multitouch gestures and timing.
I stumble upon this today while having same need.
I have solved this is by using GCDWebServer and sending post message from my app to the local web server end point hosted in UIAutomation.

Send file to print in the background from ruby on rails app

I'm looking to make an app be able to print out a stick on name tag based on some fields that the user has filled out. The catch is that I don't want the user to have to interact with any sort of system print dialog, I just want it to go straight to the printer and print out after they submit.
The other catch here is that this will most likely be run on an iPad, so I will need to try to send this print job over the air either on wifi, somehow to a computer that is usb connected to the printer or over airprint if I can find one that is small enough and supports the right paper.
I've seen some solutions here and there that require the app to run on windows, or to be connected to the printer some how.
I'm not sure if this feat is possible with this setup, but the most important part is being able to print in the background, if the iPad is going to hinder that, there is a case we can make to our client for getting a small, cheap, windows 8 touch tablet instead of an iPad since I know it has a few more capabilities in this area as it seems through my research.
It doesn't matter what version of ruby or rails it's in and I don't care if it's 2 steps or 200, if the user experience is there, I can make a case for the increased work load needed to make something work.
I'm not a very experienced rails developer, but this project is my first big project that is simple enough that I can tackle it. If more information about how their name tag info is being collected I can shed some light on that as well but I don't think it matters. Whatever I'm printing I need the experience to be the above.
Have a look here: http://support.vendhq.com/hc/en-us/articles/201378390-Enable-kiosk-silent-printing-for-Google-Chrome-on-Windows-Video- under 2) Kiosk printing for Google Chrome
Basically this is using Chrome's Kiosk printing mode. So you would have to get a PC for it to work.
The "print dialog" will pop up shortly but then automatically disappear the the document will print.

iOS- UIWebView and downloaded code

I know that Apple's terms for apps disallows downloading and executing code, but there seems to be an exception for JavaScript running in a UIWebView:
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.
Does this mean that I can download and execute interpreted code, as long as it runs in a UIWebView?
I am developing an MMO, for which I would like to allow mods. It would have clients for iOS, Android, browsers, and eventually native desktop clients. I would do it entirely in the browser, but iOS doesn't support WebGL.
Is there a way to do this without violating the license agreement? I would really like to see a full-featured version on iPad, and I would be willing to put these mods in the app store so they can be reviewed, if that's possible.
These mods would be pretty simple, but more complicated than a data file could offer.
Yes. You simply download the Javascript and put it inside script tags using a UIWebView's loadHTMLString:baseURL: method, and then getting the result of various function calls using stringByEvaulatingJavaScriptFromString: method. You'd have to define an API where your game would query specific functions in your addon, but that should be pretty easy.
In fact, you may not even need to put the UIWebView in a view anywhere - you could simply instantiate a UIWebView*, load the javascript, and make the calls.
You are correct that downloading and interpreting Javascript is acceptable.
The Facebook and Gmail apps, as well as countless others, do this.

Blackberry application works in simulator but not device

I read some of the similar posts on this site that deal with what seems to be the same issue and the responses didn't really seem to clarify things for me.
My application works fine in the simulator. I believe I'm on Bold 9000 with OS 4.6. The app is signed.
My app makes an HTTP call via 3G to fetch an XML result. type is application/xhtml+xml.
In the device, it gives no error. it makes no visual sign of error. I tell the try catch to print the results to the screen and I get nothing.
HttpConnection was taken right out of the demos and works fine in sim.
Since it gives no error, I begin to reflect back on things I recall reading back when the project began. deviceside=true? Something like that?
My request is simply HttpConnection connection = (HttpConnection)Connector.open(url);
where url is just a standard url, no get vars.
Based on the amount of time I see the connection arrows in the corner of the screen, I assume the app is launching the initial communication to my server, then either getting a bad result, or it gets results and the persistent store is not functioning as expected.
I have no idea where to begin with this. Posting code would be ridiculous since it would be basically my whole app.
I guess my question is if anyone knows of any major differences with device versus simulator that could cause something like http connection or persistent store to fail?
A build setting? An OS restriction? Any standard procedure I may have just not known about that everyone should do before beginning device testing?
Thanks
Just providing the URL will not work. You will have to append some info after the URL to determine the transport method your HTTP connection will use. For instance http://example.com;deviceside=true will use DirectTCP (you might also have to supply APN information but that's saved on the device for my phone). http://example.com;interface=wifi will use wi-fi. On OS 5 there's a ConnectionFactory class that makes this a lot easier. Here's a link that goes into more detail.
This was a tough one for me!
As Jonathan said you have to put some parameters in the url to make it work on the device. You shouldn't do it by hand but use the ConnectionFactory instead.
As you may thing this would just make it work but it doesn't!
The real problem is that not the url has been altered because it has ;interface=wifi;deviceside=true in it (in my case). Depending on the webserver accepting your request this could broke the code.
A solution I tried and that works is try to happend a fake parameter like
&foo=true -> &foo=true;deviceside=true
This will result as a standard parameter for the webserver but your device would use it to driver your connection.
On the simulator this work without this extra code because behind it there is a BIS server for you. On the device (as in my case) there isn't because I'm using a development device unregistered and without SIM (just wifi).
Another point is that the HttpConnection class doesn't handle HTTP 302 Redirect and if you get one you have to handle it manually.
It's probably an issue with the APN not being specified. See my answer for this question for details:
video streaming over http in blackberry
I would make this a comment, but I think I don't have enough rep yet for that... So I'll just answer and hope this doesn't get hosed for just pasting in some links.
I've been working on this exact sort of networking issue on our app this past week, and it is indeed tricky as some others have pointed out. Here are two links which really helped us out using HTTP on different devices, especially older devices which do not provide ConnectionFactory.
http://supportforums.blackberry.com/t5/Java-Development/Connecting-your-BlackBerry-http-and-socket-connections-to-the/td-p/206242
The first one has some code examples, including demonstration of querying the system's ServiceBook and CoverageInfo classes to make a decision about what kind of connection will work.

Resources