How to get text files onto iPhone? - ios

I am making an app where the user will probably want to import a custom settings file.
It is a tuning fork app, and there are more tuning systems in existence than you can shake a stick at. I will supply a settings file that contains maybe half a dozen common tunings. this will satisfy 99% of customers, but those who want to go the extra mile I would like to provide the option of complete customisation.
Now it doesn't make sense to make an elaborate UI design. it would take users hours of painstaking way looking up numbers on Google or using their calculator, and keying in various tuning systems.
also what if they reset their phone?
what if they want to transmit this data to the iPad?
what if they want to send their configuratino to a friend?
what if I am maintaining a wiki which holds 300 different tuning systems, and they would like to grab half a dozen?
the best solution path I can see is to have the user create a text configuration file, with a simple format. something like this:
theme: "A3"
comment: "An octave below concert pitch (ie A4 440Hz)"
presets: {
A3 220Hz=220.0
}
// http://en.wikipedia.org/wiki/Guitar_tuning
theme: "Guitar Standard Tuning"
comment:"EADGBE using 12-TET tuning"
presets {
E2=82.41
A2=110.00
D3=146.83
G3=196.00
B3=246.94
E4=329.63
}
theme: "Bass Guitar Standard Tuning"
comment: "EADG using 12-TET tuning"
presets: {
E1=41.204
A2=55.000
D3=73.416
G3=97.999
}
Question is, how to get this on to their iPhone?
I don't want to rely on iTunes. maybe they will take their phone on holiday with them, and not their computer. maybe they don't even have a Mac, and they don't have iTunes on their PC. maybe they don't have a PC. maybe they just hate iTunes?
I don't have the resources to set up server space and actually host something myself.
first question: does there exists some place on the Internet I can deposit a text file and retrieve it with a minimal URL?
second question: I would also like to provide a mechanism for the user to load the file directly from their computer, ( say for example they are off-line ) -- how to do this?

Making a file in that format seems like an awful lot of hard work for a user.
It also seems like it would be a pretty big headache for you having to parse that data as the user will undoubtably only rarely get the format correct.
If I was designing this app I would make a UI for the settings. By making the UI you decouple the app from a computer completely as you no longer have to make a text file.
The only potential reasonable solution which is not viable as you do not want to set up a web service would be to create a small web front end where a user can edit their pref's through a custom form and then save the results. Then you can serve up the info by giving them a url, but this still seems a lot harder than just doing it on the device.
Remember that you will also have to implement UI anyway or the user will be forced to use a computer to configure their app - which quickly results in your app being canned for an easier alternative.
If this is still a route you wish to continue down then see this post for filetype association:.

If I paste something into Pastie, eg
http://pastie.org/2197740
I can get the raw text back by copying the URL of the ' download ' link.
(NOTE: cannot use the 'raw' link, as that still displays an HTML file containing JavaScript)
EDIT: Using http://min.us you can actually deposit a textfile, and then pass the URL -- which you get by copying the link from the ' download ' button on the page ).
EDIT: gist.github seems to be the perfect tool for this -- you can write a text file in the browser, and save it. and pastes typically persist forever. just need to throw the URL through bit.ly to shorten it.

Related

Rendering different partials depending on user window size

I would like to test if the user's browser window.width is >= 800px
if so i would like to render partial A otherwise if window.width >= 800px.
I have little experience, please explain my options on implementation:
I am expecting either a javascript method on the page or jQuery.
I have tried
http://scottwb.com/blog/2012/02/23/a-better-way-to-add-mobile-pages-to-a-rails-site/
but
1. it doesn't work for me.
2. even if it did I expect it will work based on device being used, not pixel count.
Thank you in advance!
You could use Ahoy. The current_visit method contains the following information.
When someone visits your website, Ahoy creates a visit with lots of
useful information.
traffic source - referrer, referring domain, landing page, search
keyword location - country, region, and city
technology - browser, OS,
and device type
utm parameters - source, medium, term, content,
campaign
A request won't contain data about screen size, so in common sense the sever has no way to know what is screen width and what response to serve, as PinnyM also mentioned in comment.
A general practice is to use User Agent to detect mobile device from server. User Agent is part of request. It's not 100% accurate, but it's something you could still depend on for most cases.
However, there is still solutions for your question - serve page based on screen size.
The workaround is to use Javascript to detect screen size at first, then use JS to drop a cookie. Server is able to read the cookie and decide which template to render.
The basic repo is here: https://github.com/mattstauffer/Simple-RESS It's for PHP, but you can get the idea from the source code.
There is also Rails implementation: https://github.com/matthewrobertson/ress, and the introduction: http://matthewrobertson.org/blog/2013/02/15/introducing-ress/
My opinion: I don't like this solution though it is viable. Lots of works to do and lots of things to taking care of. I would rather user User Agent detect instead.
Sounds like using a responsive front end framework might be something to look into. I'm a big fan of Foundation, it's super easy to use it with Rails apps. And the new version of Foundation just launched today! Check it out: http://foundation5.zurb.com/

Is it possible to load interactive elements into an iOS app?

Does anyone have any ideas how I could package an external interactive slide that could be dynamically loaded by an iOS app? Is it at all possible?
e.g. Imagine having a presentation app on an iPad. There is a set of interactive slides held on the web somewhere, let's say they contain draggable elements.
Can I load one of these slide objects into the app and interact with it? If so, what format would the slide object be?
Thanks,
Mark
Technically it's possible to dynamically load bundles (NSBundle) components in an app. These bundles could even contain executable code, though AppStore guidelines prohibit use of dynamically loaded NSBundles in this way for security reasons.
Additionally you could just use a UIWebView to display some 'slides' on a webpage, though it will be very hard to make the app behave as if it's the same as the native slides - perhaps even impossible (due to how rendering of webpages work compared to native controls, for example).
Ok so lets say you have these "external interactive slides" on a web server somehow. Since you are not saying they are of a certain type (like powerpoint or such) I will just assume that these slides are of some rare format that is probably not supported by any existing apps or the Safari browser.
Then the answer to your question would be: Write your own iOS-app that can read, present and edit these slides. What format are they? Well it doesn't matter. Write an app that can download the slide data from the data and parse it, and present it on the phone.
Then let the user interact with it, and perhaps make the app upload the changes to the server.
You can do anything you like in your app, there are no limits. You just have to write the code for it. If there was some kind of standardised format, lets say you wanted your app to show powerpoint presentations, then you would have 3 choices. Use someone elseĀ“s app, or write your own app with a parser for the powerpoint files or make your own app that use some code that someone else wrote to do it (a third part library that you include in your app)
In your specific case, I can not tell if there are any third part librarys to interact with your slides, but my guess is that you will need to do most of it on your own. You could start with looking at how the web services that interact with the slides online works, and if you can interact with them from an iOS-app that you make yourself.
There is nothing stopping you from creating an app, read the slide data into the app, present it in any way you like, let the user change it, save it in your app, or upload the changes to a server. It's all up to you =)
Good luck!

translate to multiple languages

I would like to get translation from one ( best - automatically detected) language to 4 different using google-translate. My idea is to wrote a html document which contain 4 frames - in one of them I can find text form and button. After click on it, Internet browser will send demand to google translate and show results in 4 frames.
If you want a self service, hosted service that does translations and content management for you check out Localize.js
This is going to be terribly translated. As someone that speaks English well, Russian poorly, and Spanish even more poorly, I can detect that these auto-translations never come out right.
My recommendation is to serve your page through a basic system that will allow you to respond to submitted form values. Pass in &LANG=two country iso code and then have your backend serve up the correct data.
Have someone that speaks both languages prepare the content for you. Then, whenever you are serving these pages, you can also conditionally adjust CSS to account for differences in format which come from difference in language length.
If you don't have those capabilities available, make 5 pages. One in English and the other 4 in the other languages. You will seriously seem retarded to anyone that speaks those languages well if you use an auto-translate. I think this is a bad idea for any kind of professional page, even if you can work out the technical issues.
-Brian J. Stinar-
Google has an API to its translate tool that will enable you to send it some text and receive back that text translated into any language you choose.
edit: This is now a paid service

Making a firefox/chrome extension from 0

i have a website, its to exchange links, files... to say it quickly it's my 'version' of twitter+megaupload,
Well, users add links all the time and so on, but i would like user be able to syinch his bookmarks from the browser to the ones he has at his profile of mywebsite,
Where should i look into?
Basically i need to be able to:
- Acces bookmarks file (1)
- being able to send the urls to my service ( 2 )
- maybe adding the login feature (in the future)
I was google'ing about this for ages few weeks a go and i kind of give up, because i'm ok with PHP and JS, but with this plugin languages i'm very lost. So i decided posting here, wich always brings positive answers
(1) - > I don't even know where to start
(2) -> i was thinking to have a website.com/auto_import_no_confirm.php?url=[URL] and put it in a for each.
how many different languages and extension files do i have to work with? I really need any kind of tip with point (1)
feel like?
-edit-
Just found This -> https://developer.mozilla.org/En/Code_snippets/Bookmarks
wich really looks like i need, but where do i place this code?
thanks!
Might not be a bad question, but there are too many subtopics raised to answer that. (And there is too much tagspam as well. Break up your question into PHP- and Javascript-specific tasks, when you have devised the general application scheme.)
But to get started, download similar Firefox extensions (.xpi) and unzip them to inspect the general structure. You'll find examplary code for bookmark handling and invoking remote APIs pretty quickly. And basically you only need Javascript for the extension itself. (It sounds like your extension does not need much UI.)
And there are many tutorials on designing Firefox addons: http://roachfiend.com/archives/2004/12/08/how-to-create-firefox-extensions/ or http://www.google.com/search?q=firefox+develop+an+xpi
The good news first, you won't need much more than javascript if you just want to access bookmarks and send them to a server, neither on firefox nor on chrome.
But still you'll have to make yourself familiar with the apis of the browsers and learn how to develop extensions.
However, both Mozilla and Google provide all necessary information on their developer sites.
For Chrome, this is a good place to start, you'll find the api for bookmark access here.
The Corresponding site for Firefox can be found here, with information on bookmark access here.

Issues with Filemaker IWP working with hyperlinks on images

I have a filemaker database that I need to be able to link records and all associated data (including container field data) to various points placed on a large PDF image, and then make that data appear via instant web publishing when someone clicks on the marker for that area on the PDF. For example the PDF may be an image of a car, and then I would have various close up images of issues with the car and descriptions of those images as records in the database. I would then want to drop points on the base PDF image and when you clicked on those points be able to see the close up images and other data related to those images.
I'm being told this is too much for IWP because:
I need to place the markers outside filemaker via PDF annotation
Filemaker IWP can't handle the number of markers that may be necessary (it could be up to 1,000 on an E sized image.
Does anyone have a work around or explanation why this is a problem?
If I understand correctly, you would like to setup a PDF with links that will open a browser and show data related to what was clicked. Assuming that is the case, the reason this wont work is because IWP does not provide a unique URL for a unique page. For example, here on StackOverflow you can directly link to any question based on its URL:
http://stackoverflow.com/questions/3207775/ -- this question
http://stackoverflow.com/questions/4973921/ -- some other question
IWP uses Javascript and session variables to manipulate the output to the screen, so there is no way to link to a specific section of your IWP site, since the URL is always something like:
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product A
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product B
http://yoursite.com/fmi/iwp/cgi?-db=YOUR_DB-loadframes -- Product C
Because of the limited nature of IWP, you will not be able to workaround this issue. You'll need to build your own web-interface using the Custom Web Publishing Engine, either using the built-in PHP extensions or some other technology where you invoke the XML publishing API.
I agree with Nate
IWP is the wrong solution to this problem. You'd be better off simply hosting those images on a webserver.
Now here comes the plug, you can use SuperContainer to really simplify the management of the images from FileMaker.

Resources