Skip to main content

Mobomo webinars-now on demand! | learn more.

This is something that many may already use as a best practice, but if not it’s something simple and convenient to add to your repertoire. Sometimes you may have a model that requires additional information if a certain condition is met. For example, I may require a user to add more information about themselves if they wish to be listed publicly, whereas I would not if they do not wish to be listed. By combining ActiveSupport’s Object#with_options and ActiveRecord’s conditional validations, we can implement this behavior in a straightforward and readable manner (assuming here that there is a boolean field called “listed” in the database that is exposed as a checkbox or similar to the user):

class User < ActiveRecord::Base   # Our standard validations   validates_presence_of :login   validates_uniqueness_of :login    # Validations for listed users   with_options :if => :listed? do |l|     l.validates_presence_of :email     l.validates_length_of :description, :minimum => 100   end end

It’s a simple technique that piggybacks off of Rails’s automatic construction of existence query methods (in this case, listed?) for fields in the database combined with the mapping power of with_options and standard conditional validations.

Categories
Author

If you’ve ever parked your vehicle in a large parking lot you’ve realized that it would be great to have something help you memorize where your car was. Intridea’s latest iPhone application, Car Finder, helps you do just that. Unlike the cookie-cutter car finding applications in the App Store, Car Finder helps you find your car using augmented reality.

Using the camera, A-GPS and the compass built into the iPhone 3GS, Car Finder allows you to find your car by positioning an overlay on top of a live view of what’s in front of you. Also, when you mark your car Car Finder allows you to set a note for your parking spot. This is particularly useful if you know what section you’re parked in or if the GPS is spotty in the location that your car is currently parked in.

Car Finder is available now on the App Store for $0.99. Intridea offers services for application development on all major mobile platforms, which include iPhone, Android, BlackBerry, and Palm webOS. If you need help with your mobile application feel free to contact us for a quote.

Categories
Author

I've been focusing exclusively on iPhone development lately and only briefly looked at the Android SDK back when the G1 was just a glimmer in T-Mobile customers' eyes. Without a doubt the iPhone App Store is the place to sell mobile applications right now. The Android Market simply can't compete (at least, according to every single cross-platform development anecdote and statistic I've seen) when it comes to the rate of apps being sold. However, it's likely to become a bit more competitive with some of the new Android devices that are coming out.

Motorola's Droid is probably the most-discussed of the bunch, with beefy specs and a pretty slick design (and marketing campaign to boot). From a feature standpoint it's enough to make an iPhone geek want to jump ship. Whether or not the new batch of Android phones will catch on with consumers is yet to be seen, but we know that developers are getting on board.

Now, I'm not about to ditch Interface Builder for the paltry Android equivalents and start churning out mountains of XML, but the hype is enough to make me give some form of Android development a second look. I've always felt that cross-platform development is less than ideal. Some cross-platform mobile development tools rely heavily on web views or not-quite-native controls to get things done. You write HTML, and they stick it in the native platform's WebKit view and call it a day. Compared to an application developed with the native APIs you get something that is slower, looks worse, and behaves in very strange ways. You can't build the type of experience that the hardcore iPhone fans will pay for that way.

Enter Appcelerator Titanium.

Titanium combines web development with native controls through its clever JavaScript bridge. It bridges your JavaScript code to many of the native API methods on the iPhone and Android. This allows Titanium apps to really look and feel like native apps (because they are native apps, with native controls). There's even a module system to add additional native components, like OpenGL views for graphics, or libraries that don't already come with Titanium. There's a whole class of applications that seem like a great fit for Titanium. Many apps that follow the CRUD pattern and mainly deal with web services or web content are prime candidates for something like Titanium. Writing JavaScript after writing Objective-C is a bit of a breath of fresh air. Using familiar HTML and CSS markup to define layouts is great compared to configuring UITableViewCell objects on the iPhone.

Being an open-source project, however, there are still some rough edges. From the GUI tool, sometimes it takes two or three clicks (of the same button) to launch your app in the simulator, or to stop the simulator. I found that a fresh project that included Prototype.js would not build, even though Titanium let me choose it when creating the project in the first place. The ease of writing JavaScript is balanced by the difficulty of effective debugging from within the app itself. It's back to printf-style (with log4j-style levels) debugging for now. There seems to be no apparent output when JavaScript errors occur at runtime on the iPhone, and the JavaScript bridge technology may need extensive development before any more powerful debugging is possible.

The best part is that it actually does work! Despite a few obscure bugs in the Titanium library my quick-and-dirty Mobomo Blog Reader application was fairly simple to develop.

Mobomo Blog Reader

In short, I am willing to give iPhone/Android cross-development a chance for many types of apps with Titanium, and I'm interested to see where the platform goes.

-John

Categories
Tags
Author

We’re always looking for ways to make it easier to integrate Presently into your day-to-day workflow. Today, we’re happy to announce something that will make it much easier for businesses using Microsoft’s SharePoint to integrate Presently. Starting today businesses can use the Presently SharePoint Web Part.

The Presently Web Part will allow you to view and post updates to your company’s Presently account from directly inside your Microsoft SharePoint portal. For more information on the installation and usage of the Web Part, you can visit the SharePoint application page.

We have also released the source code to the web part, it’s available on GitHub. Please feel free to contact support with any additional questions.

Categories
Author

Adding to Intridea’s collection of great food finding applications for the iPhone, like iPho and iCurry, comes SushiMe. SushiMe allows you to find great sushi restaurants around you using your current location or any location that you specify. You can sort through a list of restaurants by their rating (provided by Yelp) or by their distance. With SushiMe you can also view a map of all of the restaurants around you and even call them directly from your iPhone to make reservations.

SushiMe is a free application and is available right now in the App Store. Intridea offers services for application development on all major mobile platforms, which include iPhone, Android, BlackBerry, and Palm webOS. If you need help with your mobile application feel free to contact us for a quote.

Categories
Author

Ted Leonsis of Capitals and AOL and Barg Upender

We got to meet Ted Leonsis, Capitals' owner and AOL Exec at the DC Chamber of Commerce Gala, over the weekend with our friends at Network Solutions. Ted won the "Economic impact of the year Award." During the Gala, the Capitals won against the Nashville Predators with a final score of 3-2.

Councilman Marion Berry was at the next table.

Categories
Tags
Author

AlwaysOn Mobomo

Barg will be joining fellow entrepreneurs Hooman Radfar, Matthew Voorhees, and PV Bocassm in a panel titled "Technology Innovators in the WDC Region." Our goal is to discuss ideas for fostering innovation and entrepreneurship in the government. The event is being held October 19th-21st at the Four Seasons Hotel in Washington, DC.

We look forward to seeing you there.

Categories
Tags
Author

Present.ly, our enterprise microblogging platform, which is used daily by many large corporations and government organizations, offers native versions of the application on all major mobile platforms. Today, Apple has approved the latest version of Present.ly for iPhone.

Included in this latest version is an updated user interface. The new user interface ditches the previous dark theme and replaces it with a look that is more familiar to iPhone users and is easier on the eyes. Uploaded attachments can be viewed directly from the phone. Updates with one or more attached files are indicated by a small paperclip icon within your feed.

In addition to attaching files, photos from your photo library or the iPhone camera can be added to your updates — a highly anticipated feature. This version of the app provides a more robust user experience by enabling many of the most useful features of the web client. Present.ly is a free application available in the App Store. To get Present.ly for your iPhone click on the link below.

Categories
Author

Sometimes you just want an application that gets something done quick and gets it done right -- especially if your stomach's calling. That's why we've decided to create iPho and iCurry for the iPhone.

iPho will help you find the best phở around you using your current location or any address you use using the built-in search. iCurry does the same but allows you to search through the best Indian food around.

Both of these applications will show you a list of restaurants sorted by their average rating or their distance relative to you or the address you search from. You can also drill down into each restaurant so that you can get their address, get directions, give them a call, and even see if they are open. There's even a map view which overlays all of the restaurants around you. Ratings and listings are provided using the Yelp API. Both iCurry and iPho are free applications and are available now on the App Store.

Along with the announcement of these two great applications, we at Intridea are kicking off our mobile development services for our clients. We are offering services for application development on all major mobile platforms, which include iPhone, Android, BlackBerry, and Palm webOS. We've built a great team of talented mobile developers that can help bring your product or service to the mobile market. Expect to see more mobile related announcements soon.

Need help with your mobile app? Contact us for a quote.

 

Categories
Author

Twitter’s Streaming API is one of the most exciting developments in the Twitter API in some time. It gives you the ability to create a long-standing connection to Twitter that receives “push” updates when new tweets matching certain criteria arrive, obviating the need to constantly poll for updates. TweetStream is a Ruby library to access the new API.

Installation

Installation of TweetStream is simple, it’s available as a gem on GitHub and Gemcutter.org. To install it from GitHub:

gem sources -a http://gems.github.com gem install intridea-tweetstream

To install it from Gemcutter:

gem sources -a http://gemcutter.org gem install tweetstream

Usage

TweetStream creates a long-standing HTTP connection to Twitter, so unlike other Twitter libraries you don’t simply run it once and deal with the results. Instead, you provide a block that will be yielded to with each new status that arrives. The most basic example is:

require 'rubygems' require 'tweetstream'  TweetStream::Client.new('user','pass').sample do |status|   puts "[#{status.user.screen_name}] #{status.text}" end

This will provide you with a small sample snapshot of all of the updates being posted to Twitter at this moment and print them to the screen. There are also methods available to track single-word keywords as well as the updates of a specified list of user ids (integers, not screen names). You can do that like so:

# Track the terms 'keyword1' and 'keyword2' TweetStream::Client.new('user','pass').track('keyword1', 'keyword2') do |status|   puts "[#{status.user.screen_name}] #{status.text}" end  # Track users with IDs 123 and 456 TweetStream::Client.new('user','pass').follow(123, 456) do |status|   puts "[#{status.user.screen_name}] #{status.text}" end

Handling Deletion/Limit Notices (Updated in 0.1.4)

Sometimes the Streaming API will send messages other than statuses.
Specifically, it does so when a status is deleted or rate limitations
have caused some tweets not to appear in the stream. To handle these, you can use the on_delete and on_limit methods. Example:

TweetStream::Client.new('user','pass').on_delete{ |status_id, user_id|   Tweet.delete(status_id) }.on_limit { |skip_count|   # do something }.track('intridea') do |status|   # do something with the status like normal end

Daemonization

One of the most useful features of TweetStream is its built-in daemonization functionality. This allows you to create scripts that run in the background of your machine rather than taking up an active process. To create a daemon script, you simply use TweetStream::Daemon instead of TweetStream::Client. Here’s an example:

require 'rubygems' require 'tweetstream'  # The third argument is an optional process name. TweetStream::Daemon.new('user','pass','tracker').track('keyword1','keyword2') do |status|   # Do something like dump the status to ActiveRecord   # or anything else you want. end

If you were to place the above code in a file called tracker.rb you could then run ruby tracker.rb to see a list of daemonization commands such as start, stop, or run.

TweetStream is a simple wrapper on the Streaming API, but with built-in daemonization provides powerfully flexible means of accessing the Twitter Streaming API using familiar Ruby tools. More complete code documentation is available at rdoc.info.

Update: I overlooked the deletion and rate limit notices when I wrote the initial version of the gem. As of version 0.1.4 these are handled properly.

Categories
Author
Subscribe to