[android-developers] Parse for signup purposes

2021-06-24 Thread Swaroop P
Hello,

I have downloaded a code from github which sets up a Parse server in my 
local system. I downloaded another code for android chat application from 
github which uses parse from https://parseapi.back4app.com for sign up. How 
do I make changes to either of the code so that when the android app tries 
to signup it uses the local parse server in my local system. I have given 
the link

android app
https://github.com/bbarbs/parse-android-chat-app

parse server
https://github.com/parse-community/parse-server-example


Thanks and Regards,
Swaroop

-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/9521f158-c322-4af8-a5e8-eddbd78418aan%40googlegroups.com.


[android-developers] Media Recorder start() throwing error

2011-12-19 Thread Swaroop
12-19 12:10:58.014: I/dalvikvm(250): threadid=7: reacting to signal 3
12-19 12:10:58.014: I/dalvikvm(250): Wrote stack trace to '/data/anr/
traces.txt'
12-19 12:14:41.104: E/MediaRecorder(282): start failed: -1
12-19 12:14:41.104: E/AudioRecordTest(282): start() failed
12-19 12:14:41.114: E/MediaRecorder(282): stop called in an invalid
state: 0
12-19 12:14:41.114: E/AudioRecordTest(282): stop() failed

I am getting these errors in logcat.

I thought, am getting error because I am using emulator, but I tries
with Sony Xperia X10, still I am geting 0. Can any help me to get out
of this problem...

Here is my code
--

public class HelloAndroid extends Activity {
protected int text;


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button btnGetDecibels;

btnGetDecibels = (Button) findViewById(R.id.btnGetDecibels);
final TextView tv = new TextView(this);
final String LOG_TAG = AudioRecordTest;
final String mFileName = null;


final MediaRecorder mRecorder = new MediaRecorder();



btnGetDecibels.setOnClickListener(new View.OnClickListener()
{
public void onClick(View v)
{

 mRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
mRecorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
mRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mRecorder.setOutputFile(/dev/null);
try {
mRecorder.prepare();
} catch (IllegalStateException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
try {
 mRecorder.start();
} catch (Exception e) {
Log.e(LOG_TAG, start() failed);
}


 double amp = 0.0;
mRecorder.getMaxAmplitude();
amp = mRecorder.getMaxAmplitude() / 2700.0;
try {
 mRecorder.stop();
 mRecorder.release();
} catch (Exception e) {
Log.e(LOG_TAG, stop() failed);
}

tv.setText( Amplitude:+amp);
setContentView(tv);
}
});
}
}


-- 
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] Re: Unique Phone ID

2010-12-29 Thread Swaroop
A lot of discussion on this going on here.
http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id

I am not sure of the answer which would work on
GSM/CDMA Phones + Tablets w/o phone capabilities. Any one got an
Android Tablet around to check this?

ANDROID ID would exist uniquely for Google enabled Phones as per the
link here.

On Dec 29, 1:33 am, Tommy droi...@gmail.com wrote:
 Wonderful Thanks!!

 -Original Message-
 From: android-developers@googlegroups.com 
 [mailto:android-develop...@googlegroups.com] On Behalf Of Kostya Vasilyev
 Sent: Tuesday, December 28, 2010 12:37 PM
 To: android-developers@googlegroups.com
 Subject: Re: [android-developers] Re: Unique Phone ID

 http://developer.android.com/reference/android/telephony/TelephonyMan...()

  public String getDeviceId ()
  Since: API Level 1

  Returns the unique device ID, for example, the IMEI for GSM and the
  MEID or ESN for CDMA phones. Return null if device ID is not available.

  Requires Permission: READ_PHONE_STATE

 Note that at least for GSM phones, the user can insert a new SIM card with a 
 new phone number, or change the number assigned to the same card.
 So a phone number, while unique, does not identify the device.

 -- Kostya

 28.12.2010 20:29, XiaoXiong Weng пишет:
  Um. I know that if I dial *#06# it would return the IMEI number, but
  each carrier might differ so it's probably not a good solution, I
  would stick with the cellphone number since that's accessible.

  -Original Message-
  From: android-developers@googlegroups.com
  [mailto:android-develop...@googlegroups.com] On Behalf Of Tommy
  Sent: Tuesday, December 28, 2010 11:33 AM
  To: android-developers@googlegroups.com
  Subject: RE: [android-developers] Re: Unique Phone ID

  First off thanks to everyone who responded with input. My next
  question would be is my app able to access the MEID or the IMEI number
  or is that something that can't be accessed?

  -Original Message-
  From: android-developers@googlegroups.com
  [mailto:android-develop...@googlegroups.com] On Behalf Of Indicator
  Veritatis
  Sent: Thursday, December 23, 2010 7:07 PM
  To: Android Developers
  Subject: [android-developers] Re: Unique Phone ID

  I can confirm for you that the MEID is most certainly not the same as
  ANDROID ID. Furthermore, MEID is unique to CDMA phones, so my T-Mobile
  G2, for example, does not have one. It has an IMEI instead. Like any
  other GSM phone.

  On Dec 23, 2:11 pm, Ryan Avilesryan.avi...@gmail.com  wrote:
  The MEID might be useful. I dont think this is the same as the
  ANDROID_IDOn Thu, Dec 23, 2010 at 3:58 PM, John
  Gabyjg...@gabysoft.com
  wrote:
  You could use ANDROID_ID, but be warned that I have found devices
  that return null for this value.
 http://developer.android.com/reference/android/provider/Settings.Secu...
  John
  On Dec 23, 10:21 am, Tommydroi...@gmail.com  wrote:
  Hey evereyone,
  I was wondering if there is a way to get a unique ID for the users
  phone. I imagine the IME and Serial Numbers are unique to each
  phone right? Is there a way I can request the IME number or the
  serial number or is there another number I can request that is
  unique to each phone? This is used to help secure login to an app.
  Thanks,
  Tommy
  --
  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

  --
  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

 --
 Kostya Vasilyev -- WiFi Manager + pretty widget 
 --http://kmansoft.wordpress.com

 --
 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 
 athttp://groups.google.com/group/android-developers?hl=en



-- 
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


Re: [android-developers] How to go to Home screen..?

2010-12-23 Thread swaroop chandak
Simple dude..
just call intent for this homescreen class..
like..

Intent homeScreen= *new* Intent(*this*,HomeScreen.*class*);

startActivity(homeScreen);



Swaroop


On Fri, Dec 24, 2010 at 1:21 PM, Abhilash baddam 
abhilash.androiddevelo...@gmail.com wrote:

 Hi friends,

When the user clicks on a button, I want to navigate the
 screen into Home Screen. How can we achieve this.





 Regards,
 Abhilash


 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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

Re: [android-developers] Managing activity stack?

2010-12-21 Thread swaroop chandak
I am also hving same problem which is Nikola is facing(how to restrict
backward traversing)..
if u find out any solution please let me know.

Thanks,
Swaroop

On Tue, Dec 21, 2010 at 7:30 PM, Nikola nikola1...@gmail.com wrote:

 Hi,

 I have 3 activity that are used for showing data and choosing options.
 There is menu with 3 button at the bottom that enables you to chose
 activity.

 My question is: how to handle following situations (implement them):

 1) I want to show first fourth activity at the start, but discard it after
 being shown.
 (you cannot go back and see it) ,


 2) If I am in for eg. in activity number 2 and want to go in activity 1
 then from 1 back to two,
 what is procedure for this, beacuse when I am doing this through intents I
 am leaving trail
 behind so going with back button there is whole stack. (how to avoid this).


 Thanks.

 --
 God is Real, unless declared Integer.
 J. Allan Toogood, FORTRAN programmer

 --
 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.comandroid-developers%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
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] Re: Available databases for Android

2010-12-15 Thread Swaroop
Experts correct me If I am wrong. But putting out the facts, the
things I didn't like SQLite and hope they'd be bettered in the
future.

1) There's no JDBC support for SQLite - I know we can use the Runtime
JDBC Libraries, but it's not recommended -
http://stackoverflow.com/questions/1728476/does-android-support-jdbc
2) No Connection support i.e no parallel transactions. You would
have to use 1 SQLDatabase object for 1 database file and at once only
have only one transaction i.e beginTransaction() and endTransaction()
happening at the same time. So be careful, you don't want your UI
Thread waiting to beginTransaction() while one of your background
threads is holding it for a long time.

On Dec 15, 2:08 pm, Miguel Morales therevolti...@gmail.com wrote:
 There's also CouchDB for Android:http://www.couchone.com/android



 On Wed, Dec 15, 2010 at 12:06 AM, Jawwad Farooq jawwad.far...@gmail.com 
 wrote:

  While surfing I found a very very useful resource:

 http://tordtech.blogspot.com/search/label/Benchmarking

  Please have a look ..

  On Dec 15, 10:40 am, Jawwad Farooq jawwad.far...@gmail.com wrote:
  Thanks for the link But I only need the benchmarks for available
  Android databases..

  Any other link??

  On Dec 14, 10:00 pm, Bret Foreman bret.fore...@gmail.com wrote:

   Here's a list of the standard DB performance 
   metrics:http://www.tpc.org/tpcc/

   Which ones are you interested in?

  --
  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

 --
 ~ Jeremiah:9:23-24
 Android 2D 
 MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/revoltingx

-- 
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] Re: Available databases for Android

2010-12-15 Thread Swaroop
Bob,

I am primarily referring to enterprise applications which usually have
a front end and also background threads. I agree that we should try to
have database commits in an async task even for UI Threads, but not
always that suits the actual requirement. I am stuck with a few
scenarios.. So what I plan to do (Still looking into) is to defer the
background threads if the user makes some action on the page = likely
to submit the data page soon.

On Dec 15, 5:49 pm, Bob Kerns r...@acm.org wrote:
 Re: #2 -- you don't want to do beginTransaction() in your UI thread
 anyway, really, as it can block if file IO is heavy. (I do, and I'm
 going to change it). You should make the entire transaction into an
 AsyncTask, which will keep it out of the UI thread entirely.

 I can't offhand think of a scenario where the lack of multiple
 connections (and thus serialization of transactions) would be a
 serious problem on a handheld device. But perhaps I'm just not
 stretching my brain enough. Still, for most handheld applications,
 this isn't going to be a serious limitation.

 On Dec 15, 1:45 am, Swaroop gnanaswar...@gmail.com wrote:







  Experts correct me If I am wrong. But putting out the facts, the
  things I didn't like SQLite and hope they'd be bettered in the
  future.

  1) There's no JDBC support for SQLite - I know we can use the Runtime
  JDBC Libraries, but it's not recommended 
  -http://stackoverflow.com/questions/1728476/does-android-support-jdbc
  2) No Connection support i.e no parallel transactions. You would
  have to use 1 SQLDatabase object for 1 database file and at once only
  have only one transaction i.e beginTransaction() and endTransaction()
  happening at the same time. So be careful, you don't want your UI
  Thread waiting to beginTransaction() while one of your background
  threads is holding it for a long time.

  On Dec 15, 2:08 pm, Miguel Morales therevolti...@gmail.com wrote:

   There's also CouchDB for Android:http://www.couchone.com/android

   On Wed, Dec 15, 2010 at 12:06 AM, Jawwad Farooq jawwad.far...@gmail.com 
   wrote:

While surfing I found a very very useful resource:

   http://tordtech.blogspot.com/search/label/Benchmarking

Please have a look ..

On Dec 15, 10:40 am, Jawwad Farooq jawwad.far...@gmail.com wrote:
Thanks for the link But I only need the benchmarks for available
Android databases..

Any other link??

On Dec 14, 10:00 pm, Bret Foreman bret.fore...@gmail.com wrote:

 Here's a list of the standard DB performance 
 metrics:http://www.tpc.org/tpcc/

 Which ones are you interested in?

--
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

   --
   ~ Jeremiah:9:23-24
   Android 2D 
   MMORPG:http://developingthedream.blogspot.com/,http://www.youtube.com/user/r...

-- 
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] Re: WebView - Unable to call a dynamically added Javascript (part of a HTML) inside a DIV using innerHTML

2010-10-08 Thread Swaroop
@Kypriakos - I am not sure that we're discussing the same thing here.
I am talking about DOM manipulation for setting the HTML and you seem
to be talking about HTML headers written by an AJAX call.

On Oct 5, 11:08 pm, kypriakos demet...@ece.neu.edu wrote:
 Hi Swaroop - I posted something similar in this post. I am a bit
 skeptic about how the default browser deals with js/ajax in Android
 vs how FF works:

 http://groups.google.com/group/android-developers/msg/9ea3fe940a397b88

 I don't seem to have an issue with the innerHTML in the script i am
 using
 as much as I do with the output HTTP headers of the request.
 Anything here that we can help each other with let me know.

 On Oct 2, 11:11 pm, Swaroop gnanaswar...@gmail.com wrote:



  I agree that this is more of a HTML/JS question, but I've posted it
  here because the Browser implementation behind WebView is Android
  Specific and wish to understand a generic way to put innerHTML if any
  one has done the same in Android Development. Android's WebView and
  browser implement the innerHTML in the same way that HTML spec wants,
  but its just different when talking about Javascript availability (in
  question here)

  Swaroop

  On Oct 2, 4:15 am, Doug beafd...@gmail.com wrote: This is an 
  HTML/DOM/JavaScript question, not an Android question.  The
   fact that what you're doing doesn't work in FF should be a clue that
   you're probably depending on IE-specific behavior.  Consider learning
   to use jQuery or some other JavaScript framework to do what you need
   to do to manipulate the DOM and that should work OK on mobile phones.

   Doug

-- 
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] Re: WebView - Unable to call a dynamically added Javascript (part of a HTML) inside a DIV using innerHTML

2010-10-04 Thread Swaroop
Thanks Doug, I will try to implement the same in JQuery and see if the
results are any different and post back here.

On Oct 4, 2:35 am, Doug beafd...@gmail.com wrote:
 On Oct 2, 8:11 pm, Swaroop gnanaswar...@gmail.com wrote:

  I agree that this is more of a HTML/JS question, but I've posted it
  here because the Browser implementation behind WebView is Android
  Specific and wish to understand a generic way to putinnerHTMLif any
  one has done the same in Android Development. Android's WebView and
  browser implement theinnerHTMLin the same way that HTML spec wants,
  but its just different when talking about Javascript availability (in
  question here)

 Android WebView just uses WebKit, so if you can get your code to work
 on Safari or Chrome (which both use WebKit), then you should be OK.

 Again, jQuery or any modern JS framework will abstract away any
 implementation-specific details in dealing with the DOM.

-- 
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] Re: WebView - Unable to call a dynamically added Javascript (part of a HTML) inside a DIV using innerHTML

2010-10-02 Thread Swaroop
I agree that this is more of a HTML/JS question, but I've posted it
here because the Browser implementation behind WebView is Android
Specific and wish to understand a generic way to put innerHTML if any
one has done the same in Android Development. Android's WebView and
browser implement the innerHTML in the same way that HTML spec wants,
but its just different when talking about Javascript availability (in
question here)

Swaroop

On Oct 2, 4:15 am, Doug beafd...@gmail.com wrote:
 This is an HTML/DOM/JavaScript question, not an Android question.  The
 fact that what you're doing doesn't work in FF should be a clue that
 you're probably depending on IE-specific behavior.  Consider learning
 to use jQuery or some other JavaScript framework to do what you need
 to do to manipulate the DOM and that should work OK on mobile phones.

 Doug

-- 
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] WebView - Unable to call a dynamically added Javascript (part of a HTML) inside a DIV using innerHTML

2010-10-01 Thread Swaroop
Hi Android experts,

I have a weird code situation where I need to have a DIV to hold
dynamic HTML generated. Here I am populating the DIV using its
innerHTML attribute and it works fine and dynamically adds any HTML
elements that are there in the dynamic HTML.

The problem I am facing now is if the dynamic (generated else where)
HTML contains a list of Javascript methods, these methods aren't
accessible to be callable from the buttons inside the div or outside
the div (

I was able to get the requirement working in Desktop Internet Explorer
7+. This however doesn't work on Firefox too . I understand this isn't
the best way, but to use addChild etc is, but then I would have to
manually parse my HTML myself and construct all the child elements i.e
do all that the innerHTML will do eventually (logically, i mean).

Code also uploaded to
http://pastebin.com/Q6w5hRPG 
Code works on Internet
Explorer 7+//
html
head
script
/* the input type = hidden is necessary or the JS won't 
be
accessible */
/* script defer tag is also necessary */
function insertHTMLOnButtonPress() {
var s = htmlinput type='hidden' 
id='dummyHidden'/
headscript defer='defer'function dynamicallyInsertedFunction()
{ alert('Successfully called - dynamicallyInsertedFunction'); } /sc
+ ript/headbodyinput type='text' value='Hello World'/input
type='button' onClick='dynamicallyInsertedFunction();' value='Call
Dynamically Inserted Method'//body/html;
/* Clearing out innerHTML is also required to 
flush the innerHTML
so that repeated attempts - i.e new HTML/JS should work */
document.getElementById('tempBody').innerHTML = 
'';
document.getElementById('tempBody').innerHTML = 
s;
}
/script
/head
body
**br/
!-- Don't close the div inline, causes some problem and 
replaces
the buttons too --
div id=tempBody/div
**br/
input type=button onClick=insertHTMLOnButtonPress();
value=Insert some dynamic html/
input type=button onClick=dynamicallyInsertedFunction();
value=Call Dynamically Inserted Method/
/body
/html
///

Also posted on WebDeveloper.com - 
http://www.webdeveloper.com/forum/showpost.php?p=1116504

-- 
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] Re: WebView - Unable to call a dynamically added Javascript (part of a HTML) inside a DIV using innerHTML

2010-10-01 Thread Swaroop
Just wanted to add that I experimented out a little with using an
iFrame (it finds the Javascript, but there's a huge problem with the
scope). I want any JS functions between Outer document and inner
container (dynamically added) to be flexible to call each other (like
how its behaving on a DIV). I am back to square one - Need something
approach like the DIV container where the JS would be accessible (like
how its working on the IE).

Uploaded the modified version on http://pastebin.com/MhTkdhFQ

/
html
head
script
/* the input type = hidden is necessary or the JS won't 
be
accessible */
/* script defer tag is also necessary */
function insertHTMLOnButtonPress() {
try {
var s = htmlinput type='hidden' 
id='dummyHidden'/
headscript defer='defer'function dynamicallyInsertedFunction()
{ alert('Successfully called - dynamicallyInsertedFunction'); } /sc
+ ript/headbodyinput type='text' value='Hello World'/input
type='button' onClick='dynamicallyInsertedFunction();' value='Call
Dynamically Inserted Method'//body/html;
var x = document.getElementById('test');
var y=(x.contentWindow || x.contentDocument);
if (y.document)y=y.document;

y.write(s);
} catch(ex) {
alert(ex.name);
}
}
/script
/head
body
**br/
!-- Don't close the div inline, causes some problem and 
replaces
the buttons too --
iframe id=test name=testhello world/iframe
**br/
input type=button onClick=insertHTMLOnButtonPress();
value=Insert some dynamic html/
input type=button onClick=dynamicallyInsertedFunction();
value=Call Dynamically Inserted Method/
/body
/html
/

On Oct 1, 2:14 pm, Swaroop gnanaswar...@gmail.com wrote:
 Hi Android experts,

 I have a weird code situation where I need to have a DIV to hold
 dynamic HTML generated. Here I am populating the DIV using its
 innerHTML attribute and it works fine and dynamically adds any HTML
 elements that are there in the dynamic HTML.

 The problem I am facing now is if the dynamic (generated else where)
 HTML contains a list of Javascript methods, these methods aren't
 accessible to be callable from the buttons inside the div or outside
 the div (

 I was able to get the requirement working in Desktop Internet Explorer
 7+. This however doesn't work on Firefox too . I understand this isn't
 the best way, but to use addChild etc is, but then I would have to
 manually parse my HTML myself and construct all the child elements i.e
 do all that the innerHTML will do eventually (logically, i mean).

 Code also uploaded 
 tohttp://pastebin.com/Q6w5hRPG
 Code works on Internet
 Explorer 7+//
 html
         head
                 script
                         /* the input type = hidden is necessary or the JS 
 won't be
 accessible */
                         /* script defer tag is also necessary */
                         function insertHTMLOnButtonPress() {
                                 var s = htmlinput type='hidden' 
 id='dummyHidden'/headscript defer='defer'function 
 dynamicallyInsertedFunction()

 { alert('Successfully called - dynamicallyInsertedFunction'); } /sc
 + ript/headbodyinput type='text' value='Hello World'/input
 type='button' onClick='dynamicallyInsertedFunction();' value='Call
 Dynamically Inserted Method'//body/html;
                                 /* Clearing out innerHTML is also required to 
 flush the innerHTML
 so that repeated attempts - i.e new HTML/JS should work */
                                 document.getElementById('tempBody').innerHTML 
 = '';
                                 document.getElementById('tempBody').innerHTML 
 = s;
                         }
                 /script
         /head
         body
                 **br/
                 !-- Don't close the div inline, causes some problem and 
 replaces
 the buttons too --
                 div id=tempBody/div
                 **br/
                 input type=button onClick=insertHTMLOnButtonPress();
 value=Insert some dynamic html/
                 input type=button onClick