Home
Can I access to video buffer directly from Android NDK native c code? PDF Print E-mail

 

I tried with this some days, and the answer is No and Yes!

David Turner from NDK group:

"You can't. On some devices, there isn't even a frame buffer, everything works through the HW OpenGL interface.
What you can do is access the pixel buffer of surfaces, modify them, and have them displayed."

But from Android 2.2, you have Bitmap, check it in header, it provides a video buffer that allow you to write to directly. Check the plasma sample inside the NDK directory.

 
Copy and Paste using ClipboardManager PDF Print E-mail

ClipboardManager is a interface to the clipboard service, for placing and retrieving text in the global clipboard.

You do not instantiate this class directly; instead, retrieve it through getSystemService(String).



main.xml

Read more...
 
A simple Home Screen App Widget to get Date/Time PDF Print E-mail

A simple Home Screen App Widget to get Date/Time.

In former exercise, "A dummy Android Home Screen App Widget" without any function have been implemented. Here, we add some code in the onUpdate() method to get and show the date/time on home screen in 30 minutes interval.



Bascically the structure is same as the exercise of "Create a dummy Android Home Screen App Widget".

Modify android:updatePeriodMillis to "1800000" in /res/xml/hellowidgetproviderinfo.xml. Because "updatePeriodMillis will not be delivered more than once every 30 minutes".

Modify /res/layout/hellowidget_layout.xml

Read more...
 
Gzipping files on the fly part 1 PDF Print E-mail

Today we wanted to test ways, to optimize the download of files to android phones.
The first way we tried, is the most obvious method of using a little less of everything (bandwith, battery, cpu, backlight, time? etc), compression.

Image source.

Read more...
 
Simple connection example part II - TCP communication PDF Print E-mail

Last time I wrote about UDP connection. I got some comments about the problem, that UDP packets are not guaranteed to be delivered.
This time I’m going to show you the safer option, the TCP connection.
TCP is probably the most commonly used protocol, simply because it is used for so many applications such as HTTP, POP, SMTP, etc. TCP is a protocol which guarantees that the receiver will receive exactly what the sender sent - there will be no errors, it will be in the correct order, everything will work just fine.

 
Read more...
 
« StartPrev12345678910NextEnd »

Page 1 of 86