iPhone code browser? - iphone

I want to be able to read code on my iPhone in the bus every day. Ideally, I'd like to be able to download a package, extract it to a folder, put it on the iPhone, and be able to just browse through the code (folders & files and all). Don't need to be able to edit, just read.
Is there a good solution for this? If there is not, could it be a good first project to teach myself iPhone development? or would it be too big a chunk for a first bite? (right now I mainly just do python web app development)
Thanks!

Check out the Airsharing app. When you run the app, it creates a server on your network (when sharing is enabled) and provides you an ip address you punch into a browser. You then upload files to the device via an ajax interface. Later on, you just open up the app and click the file you want to read and it displays on the screen. I've fiddled with it and it does preserve code highlighting.

You might also check out the new MobileMe iDisk app that just got released today. It looks like a slick way to share files between the iPhone and a Mac (and the cloud). You need to be a MobileMe subscriber, though.

Related

How to connect to an iphone through Java? Is this even possible?

I am trying to write a program in Java that can connect to an iPhone that is attached to a computer via apple USB cable and view its files. I have not found anything like this online and have been wondering if this is even possible. Any suggestions?
iOS is problematic because of DRM. Android is also moving in that direction making standard file system browsing difficult so I doubt it would be possible to view arbitrary files on the device.
Codename One allows you to build a Java app that will run on the iPhone itself which might allow you to access some data. However, apps running in the device also have restrictions and can't access the full file system only their own.

Force download mp3 for mobile site on iPhone

I'm working on a little mobile site for a musician and they want to be able to let users download a song for free on their mobile device. The problem I'm running into is that in Safari for iPhone the song plays in the browser no matter what and does not get added to the music library.
On Android I've been able to force a download which the user can then add to their music application of choice. I was hoping there was some way to get the song into the iPhone music library with out requiring some additional application or going through iTunes.
Any help would be greatly appreciated. Thanks!
It is not possible to have Mobile Safari download a media file from your site to a device's library. That and many other parts of the iOS filesystem are protected from external access.
Safari on iOS 13 and up finally supports file downloads, just like Android and Chrome.
According to a senior level Apple Support Rep, Apple has coded their OS to specifically prevent any audio file that does not have DRM protection, to be downloaded. This means Apple products will force a file to stream as opposed to downloading the entire file. Finding an official statement from Apple is difficult so the closest I could get was talking to a senior rep. You can, of course, call apple for free support with ANY apple product (including I-tunes on windows lol) by calling 1-800 My Apple. Most likely you can get additional confirmation there.
I actually created a site where if you click on a link with a windows or android device, it forces the download. This doesn't work on Apple devices, it still will only stream. The only real fix for this is to offer the file as a compressed file. (ie. zip) then they could download the compressed file but then they would have to open the .zip up and extract the audio.
Ironically, I'm currently looking into how I can use PHP to "zip" a file up on the server side per client request and then deliver them the file in the compressed format. I stumbled across this post because I was attempting to see if there was a way to fool a system into believing a file was in fact protected when it was not.
Hope this helps.

Is PhoneGap on iPhone pointed to local proxy possible and allowed?

We are looking on building a project that would run on Android, iPhone and other platforms with Phonegap. The app would be fairly simply, making use of the camera and basic UI features. The first versions would simply point to a web service and load information from there.
Over time, however, we want to improve the speed by:
1.) Downloading content via a separate thread when the app is running and storing the results in a local database,
2.) Hosting a mini webserver in the app*, and
3.) Pointing the PhoneGap UI to the app's mini webserver instead of the service's external webserver.
Two questions:
1.) Is it technically possible to host a mini webserver in iPhone that the app will access?
2.) Would this functionality be rejected by Apple?
Thanks in advance.
*I realize this step probably isn't really necessary. But, if it enables to truly build a "write-once-run-anywhere" UI, it might make sense still.
You're much more likely to want to have the HTML for presentation generated on your actual server, downloaded and stored by your separate thread as an .html file on the iPhone filesystem and served through local URLs using PhoneGap. Essentially, an advanced cache.
This way no web-server is necessary and you only need to write the UI generation code once on the server.

Simplest way to incorporate iPhone file upload when building app with Appcelerator's Titanium Developer

Sorry for the long explanation. Thanks in advance to all who are taking their time.
I am an Ubuntu user who has set up Titanium Developer on a MacMini in order to build an app for the iPhone (and ultimately some other platforms).
Rather than having any local code built in, the app simply points to my website. To do that, all I needed to do was change Titanium's tiapp.xml file to include my website URL. I wrote no other code, nor did I need to include any other files. It simply compiled and ran in the emulator without a hitch.
I've got just one problem: I need to upload files to my website and Apple, as most of you know, has disabled the input field type=file. I've got it working in all other browsers. The action simply calls a php file and passes the file info.
If I didn't have an app, and someone was just manually navigating to my site with the iPhone's Safari browser, I could get around the problem by using CliqCliq, which is a very cool iPhone app. Basically, I use JavaScript window.open() to launch CliqCliq's QuickPic browser in a second Safari window. The user chooses a file; QuickPic uploads it; and the user is returned to the second Safari window that I launched with window.open(). The user closes the window and Safari returns them to the first window (i.e., my website).
The problem is that my website is being shown in my app. (By the way, I don't have my developer license yet, even though I signed up a few weeks ago, and I can't test this in the emulator because I can't install QuickPic into it, I assume.) I wanted to repeat the same steps, described in the previous paragraph, using an iFrame but that didn't seem to work (i.e., the iFrame was blank despite my designating a src). I also tried having a hidden window by using old-fashioned frames and setting the col-width to 0. That also did not work (i.e., Safari, if I recall correctly, opened a separate window).
I'm working a little blind, since I can't test anything on the iPhone, but I figure I have two options: I can either find a way to launch a QuickPic in an iFrame -or- I can find some way to incorporate the Apple toolkit file chooser into the Titanium app.
The problem with the first option -- but again, I don't know until I can try this on the iPhone -- is that I assume both apps (mine and CliqCliq's) could not run at the same time. Even if I had a hidden window, invisible iFrame, etc., the moment it launches QuickPic, I assume my app would quit(?).
The problem with the second option is that I don't have clue as to how to incorporate a file picker into my app by using Titanium (keeping in mind, everyone, that I know very little). Brian at CliqCliq has even offered to give me some code if I can't make Apple's file picker work but again, I'm not sure what to do next.
What do you folks think? What's the best method? And, what's the easiest thing for a simpleton to do?
Thanks.
<input type="file"> is not supported on the iPhone. You'll need to use Titanium's APIs, specifically the Media one (openPhotoGallery or showCamera).
As a side note, Apple reportedly rejects apps that are just a webview displaying a website. You may want to consider putting most of the app code in local storage and using AJAX to fetch content.

iPhone app that access the Core Location framework over web

I was wondering if I could access the iPhones Core Location framework over a website?
My goal is to build a webapp/website that the iPhone would browse to, then upload its current GPS location. This would be a simple site primary for friends/family so we could locate each other. I can have them manually enter lng/lat but its not the easiest thing to find. If the iPhone could display or upload this automatically it would be great.
I don't own a Mac yet (waiting for the new Mac Book Pro) but would like something a little more automatic right now. Once I have the mac I could download the SDK and build a better version later. For now a webapp version would be great if possible. Thanks.
Why not simply use W3C GeoLocation API available in mobile Safari? This will work on ipod touch as well (suburb precision).
It's literally 10 lines of code and the javascript will work without change on Firefox 3.5. Far easier than scrape some third party website.
http://www.instamapper.com/iphone
iPhone App store
While this may not directly answer your question, there are quite a few iPhone apps that already do this kind of thing with GPS. Instamapper is the first one I pulled up from the app store, but I'm sure you could find something to fit your needs.
I'm pretty sure you can't do what you want directly.
The best idea I can come up with is to "reuse" an iPhone app that records location and makes it accessible on the web. Take Twitter for example. If I'm not mistaken, Tapulous' app Twinkle will grab your location and post it to your Twitter.com user profile. Here's an example of what that looks like:
From your webapp, you could then scrape the user page for each person whose location you're interested in. It's a pain in the butt, but like I said, this is the best I could come up with.
Again, if you don't want to mess with Twitter, there may be other apps out there that do this as well, but I don't personally know of any. Good luck.
We built a really thin iphone client app that simply calls a predefined .js file on our site. Works like a charm.
See arisgames.org for the project.