android.graphics.Path editor or SVG converter?

by Ken » Wed, 21 Apr 2010 05:10:15 GMT


Sponsored Links
 Anyone know of a graphical editor that will generate a
android.graphics.Path?
I'm looking for something like inkscape that would generate
appropriate commands to generate a android.graphics.Path or some kind
of conversion utility that would map SVG to an android.graphics.Path
so it can be used for drawing on a canvas...

--



Other Threads

1. Does webkit's toDataURL() for the HTML5 Canvas work on Android 2.1?

Hi all,

I am writing a tutorial about the HTML5 Canvas for mobile and did some
basic tests. While I can call the getDataURL() Method on an iPhone's
HTML5 Canvas Element, it does not seem to return the data URL on
Android 2.1 (Google Nexus One) and it's webkit-based default browser.
Here is the sample:

var dataURL = canvas.toDataURL();
var img = document.createElement('img');
img.setAttribute('src', dataURL);
document.getElementById('box').appendChild(img);

This will work on iPhone, it will add a new image element with the
same content as the canvas. It does nothing or fails on Android 2.1.

Has anyone ever gotten this to work?

I am also wondering if anyone could help me with understanding the
WebKit Build numbers and what it means with regards to what features I
can expect. For the iphone, I see a build number of 528.18, on Android
2.1's Browser I see (from the user agent strign) a WebKit build
530.17.
So it looks Android 2.1's webkit browser is more up to date, still
some features work on iPhone's webkit but not on Android. Does this
comparison just make no sense?

Thanx all!

-- 

2. Speech Recognition App

Hi,

I am beginner to Android development and trying to develop speech
recognition software using speech recognition apis available in
Android. I am not able to get the recognized speech. Please can
anybody help me in this. Here is my code.


package com.Speech;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

public class SpeechRecognizer extends Activity {

        private Button butSpeak;
        private TextView txtRecSpeech;

    private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234; //
Check this
    private ListView mList; // Check this

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Inflate our UI from its XML layout description.
        setContentView(R.layout.main);

        // Get display items for later interaction
        butSpeak = (Button) findViewById(R.id.butSpeak);

        mList = (ListView) findViewById(R.id.list);

     // Check to see if a recognition activity is present
        PackageManager pm = getPackageManager();
        List<ResolveInfo> activities = pm.queryIntentActivities(
                new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH),
0);
        if (activities.size() != 0) {

        butSpeak.setOnClickListener(
                    new OnClickListener() {
                        public void onClick(View v) {
                         startVoiceRecognitionActivity();
                        }
                    }
            );

        } else {
                butSpeak.setEnabled(false);
                butSpeak.setText("Recognizer not present");
        }

    }

    /**
     * Fire an intent to start the speech recognition activity.
     */

    private void startVoiceRecognitionActivity() {

     ArrayList<String> potentialResults = new ArrayList<String>();

     potentialResults.add("hi");
     potentialResults.add("hello");
     potentialResults.add("bye");
     potentialResults.add("welcome");
     potentialResults.add("Good Morning");
     potentialResults.add("android");

     Intent intent = new
Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
     intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,
RecognizerIntent.LANGUAGE_MODEL_FREE_FORM);
     intent.putExtra(RecognizerIntent.EXTRA_PROMPT, "Tips:\n 1) Speak
clearly into the Mic.\n 2) Speak Loudly");
     intent.putExtra(RecognizerIntent.EXTRA_RESULTS,
potentialResults);

     startActivityForResult(intent, VOICE_RECOGNITION_REQUEST_CODE);
    }

    /**
     * Handle the results from the recognition activity.
     */

    @Override
    protected void onActivityResult(int requestCode, int resultCode,
Intent data) {
        if (requestCode == VOICE_RECOGNITION_REQUEST_CODE &&
resultCode == RESULT_OK) {
            // Fill the list view with the strings the recognizer
thought it could have heard
            ArrayList<String> matches =
data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);

            butSpeak.setText(matches.toString());
            mList.setAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1,
                    matches));
        }

        super.onActivityResult(requestCode, resultCode, data);
    }



}

-- 

3. GDC 2010 "Bring your games to Android"

4. Trouble downloading the repository xml file

5. signal 11 SIGSEGV during onResume or onCreate

6. Print to PDF

7. saving username and passwd