Category Archives: Iphone

Xamarin – Migration Journey (Part 3 – Legacy code integration)

This is actually the hard part, and the failure at this point actually prevents us from moving towards with Xamarin.

We have been developing with native iOS and Android for 6 years, with lots of legacy code and libraries. Our libraries in both iOS and Android can have up to 20-30,000 lines of code. To migrate all of them to Xamarin would be a huge deal. The only solution is to connect Xamarin with those libraries.

We have libraries in 3 languages: Objective-C, Swift and Java. The first trouble came up when Xamarin could not connect with Swift framework. In our experiment, we took the risk and port 1 of our library into Objective-C. The Swift framework issue should have signaled us that something was not going right.

Anyways, we move forward with our intention to write a real project, working on both iOS and Android, and connect with 5 of our libraries and use 3 cocoapods frameworks/libraries.

For the libraries we wrote, there was not much problem, except the Swift issue mentioned above. However, with cocoapods, when people write code in all shapes and forms, the API definition kept having weird issues that we could not comprehend. We spent 3-4 man days on this, and still wasn’t sure that if the code would work or not.

We will discuss more about what binding issues we have with Xamarin that forced us to change the direction: to try to at least make a workable app with missing elements and libraries working in Xamarin

 

Xamarin Migration Journey (Part 1 – Introduction)

We are trying Xamarin as our cross platform approach. And we have learnt many things along the way, some of them were the old approach of Static Library, the API definition and how the code structure and the API design of Xamarin and iOS are somehow different.

We have quite a big codebase (more than 100 thousand lines of code) in iOS and Android in native, mainly because we deal mostly with Video Processing and some native features. We use frameworks a lot to share code between different apps. I have been looking for ways to port the code from iOS to Android in a smooth and cost saving way.

There are multiple steps that I plan to go through when adapting Cross Platform:

- Same or similar architecture between iOS and Android codebase

- Prepare the library in correct format to be reused in the Cross Platform

- Prepare the Binding

- Prepare the team with C# knowledge to migrate the codebase

- Design the module and how best the app will be separated between Shared Module and iOS Module

General Purpose GPU Programming for Mobile

 

GPU_Computing

There are times that your app collects a whole lot of data (by capturing it live or by downloading from a third party, or import from email), and you want to do a whole ton of reports and visualisations inside your app. .

To do lots of computing inside your smartphone is a very challenging job, as I have experienced myself in processing video data. A small trick is to use your GPU, which could be 10-100 times faster than your CPU in calculating floating point.

Setting up a GPU shader and calculation could be a huge task for anybody who are not familiar with OpenGL. So, this excellent GPGPU library could help you a lot, all you need to do is to change the calculation inside the vsh file. I am planning to make it even easier for anybody to use in the near future.

SnappyCam App looks very good

I just read about this on Techcrunch and try it out, it is a very handy camera app. Although I am not sure the image result looks actually great because it is only 213kb? I also would love to know how he can do it

Snappy Camera

Snappy Camera

 

http://techcrunch.com/2013/07/31/fastest-iphone-camera/

Your standard iPhone camera app is actually pretty slow, able to take just three to six photos per second at 8 megapixels each. But with SnappyCam 3.0, you can shoot 20 full-resolution photos per second thanks to a breakthrough in discrete cosine transform JPG science by its inventor. Twenty frames per second is fast enough to capture shot-by-shot animations or every gruesome detail of an extreme sports crash.

Top 5 Energy Saving Apps for Small Businesses

Software applications and resources that can allow business owners to reduce their overhead and operational costs may be a resource that few startups can afford to do without. Resources that can allow you to more easily and effectively track your electric consumption, curb demand for costly utilities or help you find the best , electric companies in Hamilton Texas, and surrounding regions have many benefits for smaller businesses and startups that are seeking to reduce the cost of their energy usage. Finding and making use of the best apps can ensure that your business is able to make use of more competitive utility rates and reduce costly waste and excessive energy consumption.

Choosing the Right Energy Provider

Paying too much for any resource could be a serious misstep, one that a business operating with fixed or limited financial resources may not be able to make. Sorting through your options and comparing electric providers and utility services in an effort to find the most cost-effective options and the greatest values can be a daunting task when you lack for the right resources to aid you in your search. Applications able to provide real time pricing information and easier navigation of the providers you have to choose from can ensure you are able to find the most beneficial options for your electrical service.

Tracking Consumption for Greater Energy Efficiency

Having to keep tabs on the operational habits and costs of powering your business is a labor intensive task, one that may rob yourself and staff of energy that would be better spent on more important matters. Software that can speed up or automate the process will ensure that you are able to stay informed about the level and cost of power consumption your operation is resulting in. Superior information may be required in order to more effectively and successfully curb your consumption.

Reducing Electric Waste
Fixtures and appliances that are not as efficient as they could be, devices that are being powered when not required and other habits and situations that could be costing you more than you might realize are all situations that can be more effectively remedied when you have access to the right information. Tracking your electrical consumption with a software application can allow you to target and identify any aspect of your operations or working process that could be made more efficient. Using less energy will reduce your utility bills and overhead expenses and may allow your business to become more profitable as a result.

Finding the Best Resources

With a number of applications to choose from, finding and selecting the best of them could seem like quite the challenge. Conducting a little research and finding the applications and software resources that will be of most benefit for your business will ensure that you do not lack for a superior resource. The tools you need to ensure your business is able to be made more efficient and less costly could make a big impact on the results and success of your efforts.

5 things to know about cross-platform development for iOS/Android

Cross Platform App

Cross Platform App

People love the idea of cross-platform development for iOS/Android or try to use a familiar language to develop apps for either or both platforms. There are many solutions and platforms out there and each of them has pros and cons, here we will try to name a few and analyse them: MonoTouch, Appcelerator, RubyMotion, PhoneGap, HTML5, Java2ObjC…

The pro is quite clear, it supports both platforms at the same time, you only need 1 guy with 1 skill (either it is C#/Javascript/HTML5 or Ruby) to learn and quickly produce apps for both platforms at the same time.

The cons are quite depending on which you choose to go with, but we will analyse them in some aspects: easy for maintenance, native performance, delay for update, community support, pricing/bankrupt, talent hiring

1. Easy for Maintenance

I found some of the platforms are challenging to maintain, just to name a few: appcelerator and phone gap… With javascript and not available debugger, when it comes to debugging, you will spend as twice/three times as much to debug. Other platforms do support debugging well like MonoTouch or RubyMotion…

One thing that most cross-platform framework has problem is that it adds another layer of complexity into your system. If some bug happens or something does not run as intended, you have three times of works. You have to check if the bug is your bug, is your framework’s bug, the interaction between the framework and the iOS/Android platform, and finally, if that is a bug of iOS/Android. Let’s take a simple example:
iOS had an old bug with rotation and I encountered that bug when I tried to use Appcelerator to build my simple project. It took me the whole day to find that bug was an Apple bug, there is a work around in Apple way but that is not well supported by Appcelerator….

2. Native Performance
When it comes to native performance, I can say that most of the third-party frameworks do well in this area. However, HTML5 is not an excel when it comes to this, or at least, not yet. Facebook has shown us an important lesson with its decision to be back to native to improve its performance. I think that in the future, when the WebKit, the hardware and the requirement for a good app has matched each other, more and more apps will be developed using HTML5 and other open web technologies. Simply, because it is open.

So, if you are building something simple and may grow well over a long time, you may consider the hybrid approach to combine HTML5 and native code. This could work well with if you can integrate it with the web service at your backend.

3. Delay for update/community support/pricing
All of them come to the same problem of third-party frameworks, that middle complexity layer that you add into your project. Most of the frameworks will update quite fast when Apple release a new version, except many minor bugs. I used to have code that is working well with Apple in the iOS4 release and stop working when iOS5 is released. The problem gets worse when most iOS5 beta still works well with my apps. So, when I try to run our app on iOS5 final release, I get panic. I don’t know what is wrong with my code, is it the middle framework, is it just Apple’s release has changed something. I finally figure out that Apple has changed some rules in their API and that affects the old way the middle framework is working. I need to wait for their update to get it work.

Most of the middle framework has their premium supports but you either have to pay more or you have to wait a hell long of time. And most of the communities are a fraction of either the iOS/Objc communities or Android communities. At there, at least somebody has worked with your problem, somebody tested and figured a work around.

4. Bankrupt?
There are quite a lot of third-party frameworks around, and I am quite sure many of them will go bankrupt or stop working after a while. Or the price can go up, or the support rate gets slow down. You don’t know what the hell is waiting for you there. If your product is very important, be careful, you don’t want to throw tens of thousands of lines of code away and start all over again. These middle frameworks code, unfortunately, are not much reusable. You can generate Objective-C/Java code from them and then continue working from that. But, believe me, reading, understanding and maintaining those generated code are as twice as hard as you write it from the beginning. I don’t say all of them may have problems, but be careful which framework you pick, how long your project will last, and make sure there is a good match. If your project is pretty longer than 3-5 years, maybe thinking deep about it…

5. Talent Hiring
This is a people management, a project management issue. I remember 3 years ago, finding a good iOS developer is as hard as hell. Although it is easier now, it may not make sense to have a whole team of engineers in Ruby/C# and 1 guy in iOS and 1 guy in Android (or 1 guy for both iOS/Android). That means you have to feed 2 more guys, training them with company’s culture, to understand the domain knowledge that you have. And when things grow, each of these 3 teams grows. Another solution is that 1 of the web guy need to learn both iOS and Android development. That’s why it may make sense for you to reuse your team’s talent. It is also a good thing to consider to have a guy with HTML5 to approach the app in hybrid (HTML5+native code) model.

Legal Case: Apple v.s Samsung

Apple v.s Samsung

Apple v.s Samsung

From CNN  and ABC:

(CNN) — A federal jury in California on Friday recommended that Apple be awarded more than $1 billion in damages after finding Samsung was guilty of “willful” violations of a number of Apple’s patents in the creation of its own mobile products.

(ABC) — Apple has scored a sweeping legal victory over Samsung as a US jury found the Korean company had copied critical features of the hugely popular iPhone and iPad and awarded the US company $1.051 billion in damages.

 

Finally, the legal battle seems to be over. I do not favor Apple much in this case, although I said earlier that a clone and direct copy should be avoided. But many later cases of the Samsung devices do not copy that much, so it would not be so fair that Samsung still has to pay for that fine. Apple has released so many secrets  that would come and harm them later.

This legal victory will certainly scare other android device owners like HTC…

 

http://edition.cnn.com/2012/08/24/tech/mobile/apple-samsung-verdict/?hpt=hp_t3

http://www.abc.net.au/news/2012-08-25/apple-wins-us-court-case-against-samsung/4222348?section=business

 

Suggested Frameworks for iOS

Here are some suggested frameworks for iOS development, since I have used all of them quite a lot. I think they are good frameworks/libraries that you may need to know. It could save you a good amount of time in researching and reinventing the wheel.

List of Frameworks/Code Snippets for Objective-C:

List of some good components

CorePlot : Core Plot is a plotting framework for OS X and iOS. It provides 2D visualization of data, and is tightly integrated with Apple technologies like Core Animation, Core Data, and Cocoa Bindings.

Core Plot Graph

Core Plot Graph

iPhone Cocoa Http Server:

CocoaHTTPServer is a small, lightweight, embeddable HTTP server for Mac OS X or iOS applications.

Sometimes developers need an embedded HTTP server in their app. Perhaps it’s a server application with remote monitoring. Or perhaps it’s a desktop application using HTTP for the communication backend. Or perhaps it’s an iOS app providing over-the-air access to documents. Whatever your reason, CocoaHTTPServer can get the job done. It provides:

 

Steve Jobs: What I feel about him

Steve Jobs

Steve Jobs

I finished this book quite a time ago, but I didn’t feel to fully understand and let all the information and knowledge penetrates into my mind. There are conflicts, there are debates, there are loves and hates from everybody. It is so easy for people to judge emotionally and I didn’t think that I understand everything to start writing it out.

There are many lessons inside this book, and each single person takes his own belief from the book. I have my own lessons, hope that it is not emotionally biased and spend time thinking through it for a while.

 

 

Autocratic, it is so necessary in the success of the company. People may believe that Steve Jobs was fired due to his wrong approach of management or people favored a salesman too much more than the product guy. I think it was mainly an organization politics problem, Steve Jobs was right but he did not get enough power and networks to back him up. I believe in his autocratic, as much as I believe in Mark Zuckerberg’s autocratic system. Forecasting an uncertain future is too hard to convince everybody to follow the leader. It is wasting both time and efforts. It was a quite shock for me while reading this article. I agree with the Jeff Bezos’s style of management in this article: https://plus.google.com/112678702228711889851/posts/eVeouesvaVX

Steve Jobs is not a genius, sorry for any of his fans. I don’t underestimate his talents and efforts but no success comes overnight. He was in a hard time after leaving Apple, building NeXT and then Pixar Animation Studios. There were up and downs in his life but he chose to stick into his core value and keep moving forward with innovative ideas. He has a great mind to recognize the great ideas, a great mind on how to make a product perfect. People may say that many ideas are not original by him. If they look deeper into the product development process, there are 2 things people must understand: the possession feeling and a great care of details. I love the ways Steve Jobs take an idea as if it is his own, as if it is his baby. That’s how passion and great care for the products are made from. If the product manager doesn’t have the feeling of the product as his own. Steve Jobs took this possession to a great level, and ignores the original owner as a whole.

The last great thing that I learn from Steve Jobs is details matter, a lot. I learnt from my own product development, from writing my own book. Details matter, a lot. People may not care about how great most of your works are, but they quickly recognize your mistakes. It is part of how people’s psychology works, they would assume you need to produce a great product so the great parts are normal. And negative emotion has a bigger impact than positive emotion.