Posts

Showing posts from July, 2012

[iPhone 5] iPhone 5 to Get Infinite Battery Life?

Image
If your iPhone battery has you seeing red more often than green, you’ll love what may be coming in the iPhone 5. The US Patent Office granted Apple a new patent yesterday for a technology that could potentially extend the life of the next iPhone battery for months, if not longer. How does it work? If you’ve see one of those flashlights you can charge by shaking, you get the concept. In the flashlight, a movable magnet passes through a wire coil and generates electricity, which is used to recharge the batteries. The technique is called “induction charging”. The problem with using the technology in mobile devices has been bulk. As Apple says in the patent, “To achieve meaningful output power, a traditional system typically includes thick coils of wire that add to the system’s overall size. Moreover, the wire coils and magnet of a traditional system are often housed in an inefficient manner that further adds to the system’s overall size.” Apple solved the pro

[Core Java] Serialization & Deserialization

Image
Objects can be flattened and inflated. Objects have state and behavior. Behaviour lies in the class but state lives in each individual object. So what happens when its time to save the state of an object? If you are writing a game, you would need a Save & Restore Game feature. Luckily there is a feature built in java which is to simply freeze-dry/ flatten / persist / dehydrate the object itself to save the state and reconstitute / inflate / restore / rehydrate to get it back.  You have lots of options for how to save the state of your Java Program, and what you will choose will probably depend on how you plan to use the saved state. Here are the options we will be looking at in this chapter.   If your data will be used by only the Java program that generated it:  Use serialization Write a file that holds flattened (serialized) objects. Then have your program read the serialized objects from the file and inflate them back into living, breathing, heap-i