[android-developers] Re: How can we register broadcastreceiver dynamically (in java file)

2011-12-22 Thread Sveinung Kval Bakken (Giant Leap Technologies AS)
http://developer.android.com/reference/android/content/Context.html#registerReceiver%28android.content.BroadcastReceiver,%20android.content.IntentFilter%29

Just use Context's registerReceiver(), e.g. from your application's
onCreate(). Remember to unregister the receiver, from an activity the
lastest point to unregister would be in onDestroy.

registerReceiver(new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
// Do something
}
}, new IntentFilter(SOME INTENT));

On Dec 22, 9:01 am, surabhi jain surabhi17.j...@gmail.com wrote:
 h,

 I want to send sms but register receiver dynamically.

 plz send me the source code.

 Thanks to all.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] The Hybridifier (just for fun)

2011-12-05 Thread Sveinung Kval Bakken (Giant Leap Technologies AS)
As a proof-of-concept of building Android apps on Amazon's EC2/AWS I
figured it would be fun to make a upload your web content and get a
Market-ready wrapped web-application in a minute.

EC2 proved to be no challenge, just reducing the build process' heap
size made it run on Amazon's micro instance like a charm.

After making a template-project, customzing the ANT script and adding
a little more Amazon love (Java process monitoring uploads to S3,
invoking the build and sending emails), it was building projects like
a charm!
You can add your own icons, app-name, package name, version codes and
the builder does the rest.

As any quick and dirty weekend project it has several bugs and quirks,
but if you want to check it out, visit 
http://sveinungkb-android.s3.amazonaws.com/index.html
and upload your application.


In a minute or five you'll (if everything went right) get an email
with a link to your application, ready to be uploaded to Android
Market if you feel like it. Javascript, DOM-storage, app cache and
cookies are some of what you can use in your web application.

If you have any comments on the anything of the above I'd be happy to
hear it.


PS: I'll keep the service running as long as people use it and the
costs are reasonable.


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en