I get asked this question all the time, particularly from non-developers: What does it really take to build an app? Inevitable follow-ups include: How much time does it take? and How much does it cost?

The person doing the asking has what he or she thinks is a pretty amazing idea, and is just starting to look for some pointers. Many times the would-be app entrepreneur has simply come up with an idea that has already been done. Other times, their idea is not technically possible. These are the easy answers to give.

Sometimes their idea is actually feasible, but could take a while, or would be quite expensive. In these cases, there are some really important things to consider before even starting down the app-building path. Here are the four most important: 

1. Is something you'll actually use?

If you're not building it for yourself, you'd better either know your market very well or be working with someone who knows the market extremely well.

Remember that the very best apps on the market are either an extension of some feature of a successful website or focus on doing one thing very, very well. Instagram helps people to share mobile photos easily. Yelp helps people find places to eat. Spotify plays music. Nest controls your thermostat.

If you want to build an app that's going to be a real hit, don't try to be the next "X for Y." Build the simple thing that you really need, and would really use,not the thing you think is cool or think that market X needs.

2. Understand that you don't determine the app's success; the market does.

The market is going to determine whether something really is useful or not. If you do your research well and know your target market, you can help the chances of your product succeeding.

A market is an ecosystem. In nature, creatures evolve over time to fit the resources of a given ecosystem. Similarly, your product has to find a way to work within the constraints and opportunities of its given ecosystem. (Hint: If you don't have a good understanding of the ecosystem your product is entering, be prepared to be clobbered by nature.)

3. Don't try to raise outside money until you have real users and real feedback.

Unless you have a proven track record, raising money for something that doesn't exist yet is really difficult--and it's getting more tricky by the minute. The easiest way to avoid disappointment is to show that real people (not just your mom or little sister) regularly use your product, and that it works to either solve their problems or provide them rich, interesting entertainment.

4. Ask yourself whether you want to be doing this for the next five years.

The first thing I ask people is if they'd be interested in running and supporting their application for the next five years. Do you want to make a location-based ad platform for retailers? Building a system like that means physically going to retailers and selling them on a system they've been pitched again and again for the last 20 years.

If you're going to sell to an unfamiliar market, "work in it" first. If you're going to sell to coffee shops, take a part time job at a coffee shop to learn the needs of the industry. Want to sell a mobile app to construction workers? Work in the construction industry. And guess what? You better love it if you're going to be committing the next 5 years of your life to it!