Showing posts with label Country: EMEA. Show all posts

Save the Date for Google Developer Day in Your Country

Wednesday, June 30, 2010 | 6:41 AM

Labels: ,

Google Developer Days are some of the most exciting and rewarding events the Developer Relations team is involved in. Each GDD offers technical sessions on mobile and web technologies including Android, Chrome, Google Web Toolkit, App Engine and more. It will also be an opportunity to meet both the Google team and other developers.

This year I'm very pleased to tell you that we're holding Developer Days in Munich, Moscow, and Prague.

Rather than reiterate the details here, I'll simply provide the dates to mark in your calendar and let the local country blogs provide the details:
Registration is not open yet, but we will let you know when registration opens for each country in the coming months.

Raw Audio Manipulation in Android

Tuesday, September 1, 2009 | 2:13 AM

Labels: ,

Version 1.5 of the Android SDK introduced a bunch of cool new features for developers. Though not as glamorous as some APIs, the new audio manipulation classes - AudioTrack and AudioRecord - offer powerful functionality to developers looking to manipulate raw audio.

These classes let you record audio directly from the audio input hardware of the device, and stream PCM audio buffers to the audio hardware for playback. Strong sauce indeed for those of you looking to have more control over audio input and playback.

Enough talk - on to the code. To test out these new APIs I put together a simple Android app that listens to 10 seconds of input from the microphone and then plays it back through the speaker in reverse. Perfect for decoding secret messages in old Beatles albums.

Start with the recording code. It's designed to record the incoming audio to a file on the SD Card that we'll read and playback later. As per the latest security patch, your application requires a uses-permission to record audio.

<uses-permission android:name="android.permission.RECORD_AUDIO"></uses-permission>

The recording code here records a new set of 16bit mono audio at 11025Hz to reverseme.pcm on the SD card.

public void record() {
int frequency = 11025;
int channelConfiguration = AudioFormat.CHANNEL_CONFIGURATION_MONO;
int audioEncoding = AudioFormat.ENCODING_PCM_16BIT;
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/reverseme.pcm");

// Delete any previous recording.
if (file.exists())
file.delete();


// Create the new file.
try {
file.createNewFile();
} catch (IOException e) {
throw new IllegalStateException("Failed to create " + file.toString());
}

try {
// Create a DataOuputStream to write the audio data into the saved file.
OutputStream os = new FileOutputStream(file);
BufferedOutputStream bos = new BufferedOutputStream(os);
DataOutputStream dos = new DataOutputStream(bos);

// Create a new AudioRecord object to record the audio.
int bufferSize = AudioRecord.getMinBufferSize(frequency, channelConfiguration, audioEncoding);
AudioRecord audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC,
frequency, channelConfiguration,
audioEncoding, bufferSize);

short[] buffer = new short[bufferSize];
audioRecord.startRecording();


while (isRecording) {
int bufferReadResult = audioRecord.read(buffer, 0, bufferSize);
for (int i = 0; i < bufferReadResult; i++)
dos.writeShort(buffer[i]);
}


audioRecord.stop();
dos.close();

} catch (Throwable t) {
Log.e("AudioRecord","Recording Failed");
}
}

Next we create a playback method that reads the file and plays back the contents in reverse. It's important to set the audio data encoding (here PCM 16 bits), channel, and frequency values to the same settings used in the AudioRecord object. Then again, playing with the playback frequency might be have its own appeal.


public void play() {
// Get the file we want to playback.
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/reverseme.pcm");
// Get the length of the audio stored in the file (16 bit so 2 bytes per short)
// and create a short array to store the recorded audio.
int musicLength = (int)(file.length()/2);
short[] music = new short[musicLength];


try {
// Create a DataInputStream to read the audio data back from the saved file.
InputStream is = new FileInputStream(file);
BufferedInputStream bis = new BufferedInputStream(is);
DataInputStream dis = new DataInputStream(bis);

// Read the file into the music array.
int i = 0;
while (dis.available() > 0) {
music[musicLength-1-i] = dis.readShort();
i++;
}


// Close the input streams.
dis.close();


// Create a new AudioTrack object using the same parameters as the AudioRecord
// object used to create the file.
AudioTrack audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC,
11025,
AudioFormat.CHANNEL_CONFIGURATION_MONO,
AudioFormat.ENCODING_PCM_16BIT,
musicLength,
AudioTrack.MODE_STREAM);
// Start playback
audioTrack.play();

// Write the music buffer to the AudioTrack object
audioTrack.write(music, 0, musicLength);


} catch (Throwable t) {
Log.e("AudioTrack","Playback Failed");
}
}

Finally, to drive this you need to update your application Activity to call the record and playback methods as appropriate. To keep this example as simple as possible I'm going to record for 10 seconds as soon as the application starts, and playback in reverse as soon as I've finished taking the sample.

To be more useful you'd almost certainly want to perform the playback operation in a Service and on a background thread.

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Thread thread = new Thread(new Runnable() {
public void run() {
record();
}
});
thread.start();


try {
wait(10000);
} catch (InterruptedException e) {}

isRecording = false;

try {
thread.join();
} catch (InterruptedException e) {}

play();
finish();
}

The AudioTrack and AudioRecord classes offer a lot more functionality than I've demonstrated here. Using the AudioTrack streaming mode you can do processing of incoming audio and playback in near real time, letting you manipulate incoming or outgoing audio and perform signal processing on raw audio on the device.

Tell us how you've used these APIs in your Android apps in the comments!

Posted by: Reto Meier, EMEA Android Developer Advocate, Google UK

Calling EMEA Developers for ADC 2

Wednesday, July 22, 2009 | 8:16 AM

Labels: ,

It's been a couple of months since the announcement of Android Developer Challenge 2 during this year's Google I/O event. San Francisco is a long way from us here in EMEA, so we're taking this opportunity to highlight ADC 2 to our local developer community.

EMEA developers were particularly well represented in ADC 1, matching the Eurovision Song Contest with entries from 42 countries across Europe, the Middle East, and Africa. EMEA contestants submitted over a third of the total entries and did us proud by comprising over a third of the 50 finalists - outnumbering even the US developers!

Since then, in EMEA alone, Android phones have been launched in 15 countries on 3 different handsets from more than 25 operators. With more handsets, countries, and operators on the way, both here and around the world, the EMEA team want to see local developers doing even better in ADC 2. With €176,000 or £150,000 (based on the USD$250,000 prize) on offer for the overall winner, we hope you see this as an excellent opportunity to get involved in Android development.

This year ADC entries will be judged by regular phone-owners all over around the world, including people in Europe, the Middle East, and Africa where Android handsets are available. So take advantage of your local knowledge and localize your apps to make them as compelling as possible, and maximise your votes, from people all over EMEA and the rest of the world.

There are more details on the ADC 2 page along with the Terms and Conditions. Entries need to be submitted by August 31, that's less than 6 weeks away, so stop reading and get to it!

Good luck and happy coding!


Posted by: Reto Meier, EMEA Android Developer Advocate, Google UK

Friend Connect goes îñţérñåţîöñåļ

Tuesday, July 14, 2009 | 11:25 AM

Labels: ,

So to kick off our first product launch announcement on this blog, what better way to do it than to add support for 47 more languages to one of our developer products. Here goes...

Hanging out online is just more fun with other people. Comments, social networks, opinion polls - it seems like everyone is looking for ways to better connect with fellow web-surfers.

It's not a huge surprise, then, that many site owners are looking for ways to "socialise" their sites.
Enter Google Friend Connect, a free and easy service from Google that helps you awaken and strengthen your community without a comprehensive knowledge of code (developers seeking deeper integration can also use the Friend Connect APIs). You need only to copy and paste a few snippets of code to enrich your site with social features such a members gadget that lets visitors join your site and a comments gadget to facilitate dialog.

Millions of websites are already using Friend Connect - but we know that some of you site owners have held off
because it wasn't available in your language. Well, that's about to change! Starting today, Friend Connect is supported in 47 additional languages, including French, Italian, German, Spanish, Greek, and Dutch (see the full list of languages on our Social Web Blog).

To learn more about Friend Connect, take a look at the video below:



With today's launch, site owners can now access the Friend Connect console in any one of 48 languages. When you add Friend Connect to a new site, it will default to your primary language. But if your site is in another language, simply set it on the site settings tab and Friend Connect will automatically render the gadgets in that language. And if you have multiple sites in different languages, you can select a different language for each of your sites.


Most Google-created gadgets, including the popular members, comments, and recommendation gadgets, are now available in all these languages. To see a list of Friend Connect gadgets available in your language, visit the gadget gallery.

Go to google.com/friendconnect to get started. And if you're developing gadgets, make sure to review the documentation on localizing OpenSocial applications.

Posted by Kasia Chmielinski, Google UK

Welcome...

| 10:38 AM

Labels: ,

Hi, welcome to the shiny new EMEA Developer blog.


With the launch of this blog, we're looking to have a platform where we can tell developers across EMEA (that's Europe, Middle East and Africa) about some of the cool stuff that we're working on. We don't want this to be a one way conversation though, let us tell you more.

First up, hopefully it's not just going to be us who are posting, we're looking for you to help out. We want to hear from you about anything cool you've built using any of the numerous Google APIs. That's right, Google Maps API, Earth API, YouTube API (data, or player), OpenSocial, Friend Connect, Android, App Engine or anything else at all. There's a lot of great stuff out there, and we want to show off the great sites and apps you've been building.

In addition, we (the developer relations team based here in EMEA) will cover a few different things. We'll be rounding up launches of interesting developer products, as well as discussing things in more detail when they launch locally. We'll occasionally post mashups and interesting apps that we think you'd like and to make sure you're always up to date, we'll keep you informed about relevant developer events that are happening in the EMEA region.

We'd also love to know what you want to read about so please leave us comments with suggestions on how we can make this blog work best for you. We're looking forward to hearing from you.

Posted by The EMEA Developer Relations Team