[android-developers] Re: about layout sizes
thank you guys ... this works :-) . DisplayMetrics metrics = new DisplayMetrics(); float _density = metrics.density; ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).setVisibility(VISIBLE); ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).getLayoutParams().width=(int) (100*_density); ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).getLayoutParams().height=(int) (90*_density); ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).requestLayout(); On Oct 24, 1:42 pm, Mark Murphy wrote: > Use Hierarchy View to see what values may be different. > > On Mon, Oct 24, 2011 at 2:29 PM, hectordu...@yahoo.com > > > > wrote: > > hi guys, > > > I am finding out that a layout (or button) size is different when > > doing the definition as folows: > > > ((RelativeLayout) > > (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).setVisibility(VISIBLE); > > ((RelativeLayout) > > (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).getLayoutParams().width=100; > > ((RelativeLayout) > > (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).getLayoutParams().height=90; > > ((RelativeLayout) > > (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).requestLayout(); > > etc > > > than when defining the xml resource: > > > > > > > > xmlns:android="http://schemas.android.com/apk/res/android"; > > android:layout_centerInParent="true" > > android:layout_width="100dip" > > android:layout_height="90dip" > > android:textSize="14dip" > > android:gravity="clip_vertical"> > > > > > > xmlns:android="http://schemas.android.com/apk/res/android"; > > android:layout_centerHorizontal="true" > > android:layout_centerVertical="true" > > android:layout_width="70dip" > > android:layout_height="60dip" > > android:textSize="14dip" > > android:gravity="clip_vertical"> > > > > android:layout_centerInParent="true" > > android:layout_width="65dip" > > android:layout_height="55dip" > > android:textStyle="bold|italic" > > android:textSize="14dip" > > android:textColor="#" > > /> > > > > > > > I mean, the screen looks with different sizes for each situation, and > > i am looking for same sizes in both cases. > > > I wonder in isn related with another parameter, like density or so > > on ... > > > -- > > 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 > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, One Low Price! -- 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] about layout sizes
hi guys, I am finding out that a layout (or button) size is different when doing the definition as folows: ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).setVisibility(VISIBLE); ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).getLayoutParams().width=100; ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).getLayoutParams().height=90; ((RelativeLayout) (app.main_gui.get(RoulleteGlobals.WHEEL_1_3_IDX))).requestLayout(); etc than when defining the xml resource: http://schemas.android.com/apk/res/android"; android:layout_centerInParent="true" android:layout_width="100dip" android:layout_height="90dip" android:textSize="14dip" android:gravity="clip_vertical"> http://schemas.android.com/apk/res/android"; android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:layout_width="70dip" android:layout_height="60dip" android:textSize="14dip" android:gravity="clip_vertical"> I mean, the screen looks with different sizes for each situation, and i am looking for same sizes in both cases. I wonder in isn related with another parameter, like density or so on ... -- 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] nested asynctask
hi guys, i wonder if it is possible to call an asynctask from another asynctask ? thanks for help! -- 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] turn off screen lock
hi guys, i would like to turn off programmatically the screen lock function ... how can i do it ? thanks in advance Hector -- 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: about Async Task
thank you guys for help :-) On Aug 18, 10:36 am, Andrew Pittman wrote: > Yes, usually AsyncTask is only able to be run once. Restarting the same task > may give you a little trouble though due to this. If you have something that > needs to run over and over again I would suggest that you look into starting > a service and loop the task you need to keep running in its own thread and > just make it sleep for the needed amount of time. As long as you have the > activity running in its own thread in a service you can loop it and make it > repeat infinitely as long as you allow the service to run. > > On Thu, Aug 18, 2011 at 8:30 AM, Streets Of Boston > wrote: > > > You mean you do NOT want to execute the same task twice (e.g. when the user > > clicks a button two or more times in quick succession)? > > > If so, then disable the button until the AsyncTask has finished. > > You know when it's finished by implementing/overriding the onPostExecute > > method and from there you can enable that button again. > > > -- > > 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
[android-developers] Re: about Async Task
ok guys, i get it .. i suposse so :-( so ... considering that the application executes the task instance after the ocurrence of an user event (clickable button ...), how it is supossed to be controlled a double ocurrence of the same user requirement ... i mean, the user makes double click and the application tries to execute twice the same requirement (because input data is the same). is it something to be controlled just by logical ? does it have a relationship whit isAlive() method ?? thanks for help! On Aug 17, 4:36 pm, Mark Murphy wrote: > On Wed, Aug 17, 2011 at 5:26 PM, hectordu...@yahoo.com > > wrote: > > yes, that's what i do, > > This claim runs counter to: > > > but it is not clear for me, what means "task can be executed only > > once", if we suposse to do it exactly the opossite way .. > > No, you are not supposed to "do it exactly the opossite [sic] way". > You are supposed to do it the way Streets of Boston indicated. > > In other words, you can do this: > > MyAsyncTask task=new MyAsyncTask(); > > task.execute(); > > // later > > task=new MyAsyncTask(); > task.execute(); > > but you cannot do: > > MyAsyncTask task=new MyAsyncTask(); > > task.execute(); > > // later > > // skipping task=new MyAsyncTask(); by trying to reuse the existing instance > task.execute(); > > You better follow what Streets of Boston tells you to do. He is a > rather large person. :-) > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > _Android Programming Tutorials_ Version 3.9 Available! -- 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: about Async Task
yes, that's what i do, but it is not clear for me, what means "task can be executed only once", if we suposse to do it exactly the opossite way .. On Aug 17, 3:34 pm, Streets Of Boston wrote: > Then create a subclass of AsyncTask that does the same thing in the > background. > Then each time create a new instance of that subclass and call 'execute()' > on it. -- 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] about Async Task
hi guys, i wonder what exactly means: "The task can be executed only once (an exception will be thrown if a second execution is attempted." i now that the answer seems to be logic, but i would like to use async task in order to execute different instances of the same process, with different data, and CONCURRENTLY am i wrong ? ... thanks for comments hector -- 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: Activity Lifecycle question
Veritatis, yes, it is working fine :-) in fact, the only thing i changed was to include (override) the onBackPressed() method as it was posted. goBack() also remains as it was posted, calling finish() at the end, after calling setResult(RESULT_OK, rit). methods onPause, onStop, on destroy are not calling goBack anymore. another solution that i tested (... bad idea ...) succesfullly, was to eliminate any action once pressed the back button, which can be done by just calling "return" in the onBackPressed() method. if any one needs, i can post more detail of the source code. thanks again, for all of you guys ... On Aug 14, 12:29 am, Indicator Veritatis wrote: > Test thoroughly before you say "it works". I have to say this because > 1) the solution you describe still has a bad feel to it and 2) you > TALK about "calling finish()", but you don't show it in this latest > post. Are you calling it from goBack()? As the last thing it does? > > On Aug 13, 8:21 pm, "hectordu...@yahoo.com" > wrote: > > > thank you guys, > > finally it works by overriding the back button, calling goBack() and > > also calling finish(). > > > @Override > > public void onBackPressed() { > > goBack(); > > //return; > > }//onBackPressed > > > hector > > > On Aug 13, 12:00 pm, TreKing wrote: > > > > On Sat, Aug 13, 2011 at 11:22 AM, hectordu...@yahoo.com < > > > > hectordu...@yahoo.com> wrote: > > > > i am trying to also do it form onPause(), onStop() , onDestroy . :- > > > > Well there's your problem. > > > > I don't know what will actually happen with you doing this, but that seems > > > wrong. Those methods are already called when the user has backed out, so > > > calling goBack() (and thus finish()) in them seem like it should be > > > blowing > > > your stack or ripping the time-space continuum. > > > > Don't call goBack() in those functions. If you need to set some result > > > Intent data, do that, but don't call finish(). > > > > OR, override the back key (see the Android blog for info on this) to stop > > > the current automatic finish(), then call your goBack() method. > > > > - > > > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > > > transit tracking app for Android-powered devices -- 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: Activity Lifecycle question
thank you guys, finally it works by overriding the back button, calling goBack() and also calling finish(). @Override public void onBackPressed() { goBack(); //return; }//onBackPressed hector On Aug 13, 12:00 pm, TreKing wrote: > On Sat, Aug 13, 2011 at 11:22 AM, hectordu...@yahoo.com < > > hectordu...@yahoo.com> wrote: > > i am trying to also do it form onPause(), onStop() , onDestroy . :- > > Well there's your problem. > > I don't know what will actually happen with you doing this, but that seems > wrong. Those methods are already called when the user has backed out, so > calling goBack() (and thus finish()) in them seem like it should be blowing > your stack or ripping the time-space continuum. > > Don't call goBack() in those functions. If you need to set some result > Intent data, do that, but don't call finish(). > > OR, override the back key (see the Android blog for info on this) to stop > the current automatic finish(), then call your goBack() method. > > - > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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: Activity Lifecycle question
i callled goBack() with sucess from a button: mButton_thisSpinValue.setOnLongClickListener(new View.OnLongClickListener() { public boolean onLongClick(View v) { Toast.makeText(HDART10Activity.this, "GO BACK ...", Toast.LENGTH_SHORT).show(); goBack(); return true; }//onLongClick }); //clickListener i am trying to also do it form onPause(), onStop() , onDestroy . :- ( @Override public void onStop() { super.onStop(); goBack(); }//onStop thanks for help .. On Aug 12, 11:05 pm, TreKing wrote: > On Fri, Aug 12, 2011 at 5:36 PM, hectordu...@yahoo.com < > > hectordu...@yahoo.com> wrote: > > i wonder if somebody has an idea to deal with this issue; i tried to catch > > the RESULT_CANCELED but nothing happens, the activity 1 is as follows: > > How and where are you calling your "goBack()" method? > > - > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago > transit tracking app for Android-powered devices -- 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: Activity Lifecycle question
1- i saw an example using super.onActivityResult() using it after the "if" didnt make any difference! 2-the process code is for RESULT_OK: yellowRoullete = (Roullete) rit.getParcelableExtra("updatedYellowRoullete"); blueRoullete = (Roullete) rit.getParcelableExtra("updatedBlueRoullete"); redRoullete = (Roullete) rit.getParcelableExtra("updatedRedRoullete"); which means recovering the three instances which were returned from activity 2. thanks for comments On Aug 12, 6:36 pm, Indicator Veritatis wrote: > Two questions: 1) why do you call super.onActivityResult()? The > ApiDemo examples do not. If you must call it, you should call if after > your own processing, since you want to catch the CANCELED first 2) > what code DO you have for handling other result codes? You should have > a default case at least so that you can put breakpoints there. > > On Aug 12, 3:36 pm, "hectordu...@yahoo.com" > wrote: > > > thank you guys for comments, > > > i wonder if somebody has an idea to deal with this issue; i tried to > > catch the RESULT_CANCELED but nothing happens, > > the activity 1 is as follows: > > > public void onActivityResult(int requestCode, int resultCode, Intent > > rit) { > > super.onActivityResult(requestCode, resultCode, rit); > > > if (resultCode == RESULT_OK) { > > yellowRoullete = (Roullete) > > rit.getParcelableExtra("updatedYellowRoullete"); > > blueRoullete = (Roullete) > > rit.getParcelableExtra("updatedBlueRoullete"); > > redRoullete = (Roullete) > > rit.getParcelableExtra("updatedRedRoullete"); > > > }else if (resultCode == RESULT_CANCELED) { > > redButton.setText("hDART CANCELLED ..."); > > Log.d("hDART", "CANCELLLED"); > > > }else { > > redButton.setText("INTERACTION ERROR ..."); > > Log.d("INTERACTION", "ERROR"); > > > }//if > > } > > > after the user press back (in activity 2), application goes back to > > activity 1 but result is lost ... same an ESC :-( > > > ... yes, onResume() is also too late ... > > > thanks for help... > > > On Aug 12, 2:21 pm, Mark Murphy wrote: > > > > On Fri, Aug 12, 2011 at 3:17 PM, Kostya Vasilyev > > > wrote: > > > > Try calling setResult from onPause - I believe onStop is too late, due > > > > to how Start/Stop/Pause/Resume are intermingled. > > > > Last I checked, even onPause() is too late. > > > > Hector: > > > > The idea is that you call setResult() when the user makes a choice > > > (e.g., from onListItemClick() of a ListActivity). The BACK button is > > > effectively like hitting on a desktop dialog box, indicating > > > that you didn't really want to make that choice in the first place. As > > > TreKing notes in his reply he sent while I was typing this, > > > onActivityResult() is called with RESULT_CANCELED, so you can detect > > > this case. > > > > Any activity started via startActivityForResult() must be designed to > > > allow users to say "sorry, never mind". In fact, pretty much > > > everything in Android needs to support "sorry, never mind". > > > > -- > > > Mark Murphy (a Commons > > > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > > Android Training...At Your Office:http://commonsware.com/training -- 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: Activity Lifecycle question
thank you guys for comments, i wonder if somebody has an idea to deal with this issue; i tried to catch the RESULT_CANCELED but nothing happens, the activity 1 is as follows: public void onActivityResult(int requestCode, int resultCode, Intent rit) { super.onActivityResult(requestCode, resultCode, rit); if (resultCode == RESULT_OK) { yellowRoullete = (Roullete) rit.getParcelableExtra("updatedYellowRoullete"); blueRoullete = (Roullete) rit.getParcelableExtra("updatedBlueRoullete"); redRoullete = (Roullete) rit.getParcelableExtra("updatedRedRoullete"); }else if (resultCode == RESULT_CANCELED) { redButton.setText("hDART CANCELLED ..."); Log.d("hDART", "CANCELLLED"); }else { redButton.setText("INTERACTION ERROR ..."); Log.d("INTERACTION", "ERROR"); }//if } after the user press back (in activity 2), application goes back to activity 1 but result is lost ... same an ESC :-( ... yes, onResume() is also too late ... thanks for help... On Aug 12, 2:21 pm, Mark Murphy wrote: > On Fri, Aug 12, 2011 at 3:17 PM, Kostya Vasilyev wrote: > > Try calling setResult from onPause - I believe onStop is too late, due > > to how Start/Stop/Pause/Resume are intermingled. > > Last I checked, even onPause() is too late. > > Hector: > > The idea is that you call setResult() when the user makes a choice > (e.g., from onListItemClick() of a ListActivity). The BACK button is > effectively like hitting on a desktop dialog box, indicating > that you didn't really want to make that choice in the first place. As > TreKing notes in his reply he sent while I was typing this, > onActivityResult() is called with RESULT_CANCELED, so you can detect > this case. > > Any activity started via startActivityForResult() must be designed to > allow users to say "sorry, never mind". In fact, pretty much > everything in Android needs to support "sorry, never mind". > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training...At Your Office:http://commonsware.com/training -- 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: Activity Lifecycle question
:-( so, if the user press back, the method setResult(RESULT_OK, rit), called from onStop() ... does not work? On Aug 12, 12:35 pm, Mark Murphy wrote: > On Fri, Aug 12, 2011 at 1:16 PM, hectordu...@yahoo.com > > wrote: > > "have Activity 1 use > > startActivityForResult() to start up Activity 2, with Activity 2 > > sending the result back via setResult(), followed by finish(). " > > > ok, thats exactly what the activities do; but the result back doesnt > > work when the hardware keyboarb (back) is used. > > It's not supposed to. If they press BACK, that means they are not > choosing something. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training...At Your Office:http://commonsware.com/training -- 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: Activity Lifecycle question
"have Activity 1 use startActivityForResult() to start up Activity 2, with Activity 2 sending the result back via setResult(), followed by finish(). " ok, thats exactly what the activities do; but the result back doesnt work when the hardware keyboarb (back) is used. What actvity 2 does is: public void goBack(){ rit = new Intent(); rit.putExtra("updatedYellowR", yellowR); rit.putExtra("updatedBlueR", blueR); rit.putExtra("updatedRedR", redR); setResult(RESULT_OK, rit); finish(); }//goBack yelllowR, blueR and redR are instances of the same class ... objects On Aug 12, 12:05 pm, Mark Murphy wrote: > On Fri, Aug 12, 2011 at 1:02 PM, hectordu...@yahoo.com > > wrote: > > Hi guys, > > My app has two activities with a parcelable object going forward and > > back between them, which works fine. The problem comes when user goes > > back (from activity 2 to main activity) by using the hardware > > keyboard. In that moment the method onStop suppose to be called and > > the activity must launch an intent in order to save results into the > > main activity, which doens not work :-( > > > I wonder what i am doing wrong? ... > > Activity 2 should not "launch an intent in order to save results into > the main activity". > > If Activity 2 feels a bit like a dialog box (e.g., "Please pick > something out of this list"), have Activity 1 use > startActivityForResult() to start up Activity 2, with Activity 2 > sending the result back via setResult(), followed by finish(). > > If Activity 2 is just some other activity (e.g., "Please edit the > thing you picked in Activity 1"), then Activity 1 and Activity 2 > should be sharing a real data model (database, content provider, > etc.). > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Android Training...At Your Office:http://commonsware.com/training -- 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] Activity Lifecycle question
Hi guys, My app has two activities with a parcelable object going forward and back between them, which works fine. The problem comes when user goes back (from activity 2 to main activity) by using the hardware keyboard. In that moment the method onStop suppose to be called and the activity must launch an intent in order to save results into the main activity, which doens not work :-( I wonder what i am doing wrong? ... i also tried onDestroy without sucess. thanks for help hector -- 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: transparent images
thanks a lot :-) ((Button) findViewById(R.id.spinButton_5)).setBackgroundDrawable(getDrawable(R.drawable.d0)); Bitmap wheelSpin = BitmapFactory.decodeResource(getResources(), R.drawable.blue_chip); Canvas canvas = new Canvas(wheelSpin); Bitmap oneSpin = BitmapFactory.decodeResource(getResources(), R.drawable.american_n10); canvas.drawBitmap(oneSpin, 0, 0, null); Drawable d =new BitmapDrawable(wheelSpin); ((Button) findViewById(R.id.spinButton_5)).setBackgroundDrawable(d); On Aug 10, 6:28 pm, Jon Shemitz wrote: > setBackgroundDrawable() sets the Drawable to use as a background; it doesn't > draw on top of the existing background. To do what you want, you'll have to > load the opaque background, draw the transparent overlay on top of it, > create a BitmapDrawable from the composite image, then use that as your > button's background. -- 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] transparent images
hi guys, i am trying to overlap two images, a transparent one over an opaque button background. Three simple lines: res = getResources(); Drawable spinImage = res.getDrawable(R.drawable.n8); ((Button) findViewById(R.id.spinButton_5)).setBackgroundDrawable(spinImage); i also used setBackgroundResource instead of setBackgroundDrawable .. the problem is that i am losting the background image, not overlaping happend, the new transparent image replace the whole opaque background. I have to use clickable buttons an doit from source code because the image file name is variable. the image is transparent for sure ... what is wrong ? thanks for help hector -- 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: Installing APK + DB
hi guys, thanks for comments, i've strongly reduced the size of my DB :-) and thigs are better now! btw, 1 . I am working in improving the activity lifecycle and i am getting also a message like " appl is not responding, force quit OR WAIT". by typing WAIT the process continues ... is there a timer somewhere ? or it is also an "activity change" related issue ? 2. may somebody send me a ":memory:" database example ? thanks in advance, On Jul 11, 7:14 am, lbendlin wrote: > Or just include it as a raw resource (give the file a silly name so Android > doesn't think it is a database) and then upon the initial program run/ > database version update use your copy routine to place the (large) database > stub where you need it. -- 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: Installing APK + DB
hey guys, i am getting problems, again, with the DB; it happens when the DB size is great than 1MB. i have my DB in the assets folder and first time is copied to the data/ data/APPL/databases directory. i wonder if the 1MB restriction for the assets folder is still an application constraint ? i am asking because somewhere i found that it was solved ... my appl is android 2.2. x sansung galaxy S. regards On Jul 8, 11:20 am, "hectordu...@yahoo.com" wrote: > hi kostya, > i get your point, i'll try to find the bug; btw, if you have any > advice on how to deal with it, i willl apreciate it very much. > > soo, i will post what happened! > > regards > > hector > > pd.about the double click conflict, i used setOnLongClickListener > instead of onDblClick. > > On Jul 7, 1:10 pm, Kostya Vasilyev wrote: > > > Hector, > > > What I was hinting at (sorry if I was being too oblique) is that: > > > 1 - There is a bug in your code when the activity gets recreated for > > configuration changes; > > 2 - The most frequent case of a configuration change is the screen > > orientation change; > > 3 - There are other cases configuration change cases, and I provided the > > steps for one of them; > > 4 - Rather than putting lipstick over the bug with your manifest change, > > treat it as an opportunity to easily find and fix the bug; > > 5 - Once that's done, and your code survives an orientation change, add > > back the manifest changes as an optimization, if needed. > > > -- Kostya > > > 07.07.2011 20:31, hectordu...@yahoo.com пишет: > > > > "your application is still likely crash if you leave it > > > by pressing Home, change the phone's language in Settings, and return > > > to > > > the app (via launcher icon or recent app list)..." > > > > YEAH ! > > > it is still crashing but i don't know exactly when :-( > > > but ot works fine by pressing HOME, or returning to the app via the > > > icon. > > > > it sounds rare but is there a light sensor some where in the phone? > > > > On Jul 6, 12:11 pm, "hectordu...@yahoo.com" > > > wrote: > > >> no kostya, > > >> by the moment it thasn't crash for that ... > > >> know i am geting conflicts with single and double click on a > > >> button .. :-( > > >> it looks like when i make a double click also tryes to execute some > > >> associates methods to single click ... > > >> plase help :-) > > >> hector > > > >> On Jul 5, 1:33 pm, Kostya Vasilyev wrote: > > > >>> That's good, but your application is still likely crash if you leave it > > >>> by pressing Home, change the phone's language in Settings, and return to > > >>> the app (via launcher icon or recent app list)... > > >>> 05.07.2011 22:13, hectordu...@yahoo.com пишет: > > >>>> about the screen orientation, i have included this line in the > > >>>> manfest: > > >>>> android:configChanges="orientation|keyboardHidden" > > >>>> ... works:-) > > >>> -- > > >>> Kostya Vasilyev > > > -- > > Kostya Vasilyev -- 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: Installing APK + DB
hey guys, i am getting problems, again, with the DB; it happens when the DB size is great than 1MB. i have my DB in the assets folder and first time is copied to the data/ data/APPL/databases directory. i wonder if the 1MB restriction for the assets folder is still an application constraint ? i am asking because somewhere i found that it was solved ... my appl is android 2.2. x sansung galaxy S. regards On Jul 8, 11:20 am, "hectordu...@yahoo.com" wrote: > hi kostya, > i get your point, i'll try to find the bug; btw, if you have any > advice on how to deal with it, i willl apreciate it very much. > > soo, i will post what happened! > > regards > > hector > > pd.about the double click conflict, i used setOnLongClickListener > instead of onDblClick. > > On Jul 7, 1:10 pm, Kostya Vasilyev wrote: > > > Hector, > > > What I was hinting at (sorry if I was being too oblique) is that: > > > 1 - There is a bug in your code when the activity gets recreated for > > configuration changes; > > 2 - The most frequent case of a configuration change is the screen > > orientation change; > > 3 - There are other cases configuration change cases, and I provided the > > steps for one of them; > > 4 - Rather than putting lipstick over the bug with your manifest change, > > treat it as an opportunity to easily find and fix the bug; > > 5 - Once that's done, and your code survives an orientation change, add > > back the manifest changes as an optimization, if needed. > > > -- Kostya > > > 07.07.2011 20:31, hectordu...@yahoo.com пишет: > > > > "your application is still likely crash if you leave it > > > by pressing Home, change the phone's language in Settings, and return > > > to > > > the app (via launcher icon or recent app list)..." > > > > YEAH ! > > > it is still crashing but i don't know exactly when :-( > > > but ot works fine by pressing HOME, or returning to the app via the > > > icon. > > > > it sounds rare but is there a light sensor some where in the phone? > > > > On Jul 6, 12:11 pm, "hectordu...@yahoo.com" > > > wrote: > > >> no kostya, > > >> by the moment it thasn't crash for that ... > > >> know i am geting conflicts with single and double click on a > > >> button .. :-( > > >> it looks like when i make a double click also tryes to execute some > > >> associates methods to single click ... > > >> plase help :-) > > >> hector > > > >> On Jul 5, 1:33 pm, Kostya Vasilyev wrote: > > > >>> That's good, but your application is still likely crash if you leave it > > >>> by pressing Home, change the phone's language in Settings, and return to > > >>> the app (via launcher icon or recent app list)... > > >>> 05.07.2011 22:13, hectordu...@yahoo.com пишет: > > >>>> about the screen orientation, i have included this line in the > > >>>> manfest: > > >>>> android:configChanges="orientation|keyboardHidden" > > >>>> ... works:-) > > >>> -- > > >>> Kostya Vasilyev > > > -- > > Kostya Vasilyev -- 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: Installing APK + DB
hi kostya, i get your point, i'll try to find the bug; btw, if you have any advice on how to deal with it, i willl apreciate it very much. soo, i will post what happened! regards hector pd.about the double click conflict, i used setOnLongClickListener instead of onDblClick. On Jul 7, 1:10 pm, Kostya Vasilyev wrote: > Hector, > > What I was hinting at (sorry if I was being too oblique) is that: > > 1 - There is a bug in your code when the activity gets recreated for > configuration changes; > 2 - The most frequent case of a configuration change is the screen > orientation change; > 3 - There are other cases configuration change cases, and I provided the > steps for one of them; > 4 - Rather than putting lipstick over the bug with your manifest change, > treat it as an opportunity to easily find and fix the bug; > 5 - Once that's done, and your code survives an orientation change, add > back the manifest changes as an optimization, if needed. > > -- Kostya > > 07.07.2011 20:31, hectordu...@yahoo.com пишет: > > > > > "your application is still likely crash if you leave it > > by pressing Home, change the phone's language in Settings, and return > > to > > the app (via launcher icon or recent app list)..." > > > YEAH ! > > it is still crashing but i don't know exactly when :-( > > but ot works fine by pressing HOME, or returning to the app via the > > icon. > > > it sounds rare but is there a light sensor some where in the phone? > > > On Jul 6, 12:11 pm, "hectordu...@yahoo.com" > > wrote: > >> no kostya, > >> by the moment it thasn't crash for that ... > >> know i am geting conflicts with single and double click on a > >> button .. :-( > >> it looks like when i make a double click also tryes to execute some > >> associates methods to single click ... > >> plase help :-) > >> hector > > >> On Jul 5, 1:33 pm, Kostya Vasilyev wrote: > > >>> That's good, but your application is still likely crash if you leave it > >>> by pressing Home, change the phone's language in Settings, and return to > >>> the app (via launcher icon or recent app list)... > >>> 05.07.2011 22:13, hectordu...@yahoo.com пишет: > >>>> about the screen orientation, i have included this line in the > >>>> manfest: > >>>> android:configChanges="orientation|keyboardHidden" > >>>> ... works:-) > >>> -- > >>> Kostya Vasilyev > > -- > Kostya Vasilyev -- 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: Installing APK + DB
"your application is still likely crash if you leave it by pressing Home, change the phone's language in Settings, and return to the app (via launcher icon or recent app list)..." YEAH ! it is still crashing but i don't know exactly when :-( but ot works fine by pressing HOME, or returning to the app via the icon. it sounds rare but is there a light sensor some where in the phone? On Jul 6, 12:11 pm, "hectordu...@yahoo.com" wrote: > no kostya, > by the moment it thasn't crash for that ... > know i am geting conflicts with single and double click on a > button .. :-( > it looks like when i make a double click also tryes to execute some > associates methods to single click ... > plase help :-) > hector > > On Jul 5, 1:33 pm, Kostya Vasilyev wrote: > > > That's good, but your application is still likely crash if you leave it > > by pressing Home, change the phone's language in Settings, and return to > > the app (via launcher icon or recent app list)... > > > 05.07.2011 22:13, hectordu...@yahoo.com пишет: > > > > about the screen orientation, i have included this line in the > > > manfest: > > > android:configChanges="orientation|keyboardHidden" > > > > ... works:-) > > > -- > > Kostya Vasilyev -- 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: Installing APK + DB
no kostya, by the moment it thasn't crash for that ... know i am geting conflicts with single and double click on a button .. :-( it looks like when i make a double click also tryes to execute some associates methods to single click ... plase help :-) hector On Jul 5, 1:33 pm, Kostya Vasilyev wrote: > That's good, but your application is still likely crash if you leave it > by pressing Home, change the phone's language in Settings, and return to > the app (via launcher icon or recent app list)... > > 05.07.2011 22:13, hectordu...@yahoo.com пишет: > > > about the screen orientation, i have included this line in the > > manfest: > > android:configChanges="orientation|keyboardHidden" > > > ... works:-) > > -- > Kostya Vasilyev -- 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: Installing APK + DB
about the screen orientation, i have included this line in the manfest: android:configChanges="orientation|keyboardHidden" ... works :-) On Jul 5, 12:42 pm, "hectordu...@yahoo.com" wrote: > thanK you guys, > finallly I followed this link and > works:www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-ap... > > i had some problems with the package name, which throws in "error > copying the database", and then with a table which wasn't found in > the schema. > > it wasn't clear for me but i had to copy the sqlite file to the > resources folder and also to the data/data/MYAPPL/database directory. > > anyway, i continuous without understanding why something that works in > the emulator doesn't works in the real device WITHOUT CHANGES. > > finally it worked :-( > > NOW I HAVE ANOTHER PROBLEM :-( > WHEN MY PHONE (SAMSUNG TAB) SWITCHS THE IMAGE FROM VERTICAL TO > HORIZONTAL, THERE IS AN EXCEPTION THAT I DON'T KNOW HOW TO CATCH, AND > THE APPL CRASH MAY SOMEBODY TELL ME WHATS GOING ON ? .. IS > THERE SOMEWHERE AN EXAMPLE CODE TO DEAL WITH ? > REGARDS ... > > On Jul 5, 7:15 am, Pepijn Van Eeckhoudt > wrote: > > > On 04/07/2011 03:19, NikolaMKD wrote:> Save it as resource in raw folder, > > load it as resource then try to > > > copy it into app path. It does not need to be inside /databases > > > folder. It can be anywhere (SDcard not recommended) > > > Why is copying onto the sdcard not recommeded? > > > Pepijn -- 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: Installing APK + DB
thanK you guys, finallly I followed this link and works: www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ i had some problems with the package name, which throws in "error copying the database", and then with a table which wasn't found in the schema. it wasn't clear for me but i had to copy the sqlite file to the resources folder and also to the data/data/MYAPPL/database directory. anyway, i continuous without understanding why something that works in the emulator doesn't works in the real device WITHOUT CHANGES. finally it worked :-( NOW I HAVE ANOTHER PROBLEM :-( WHEN MY PHONE (SAMSUNG TAB) SWITCHS THE IMAGE FROM VERTICAL TO HORIZONTAL, THERE IS AN EXCEPTION THAT I DON'T KNOW HOW TO CATCH, AND THE APPL CRASH MAY SOMEBODY TELL ME WHATS GOING ON ? .. IS THERE SOMEWHERE AN EXAMPLE CODE TO DEAL WITH ? REGARDS ... On Jul 5, 7:15 am, Pepijn Van Eeckhoudt wrote: > On 04/07/2011 03:19, NikolaMKD wrote:> Save it as resource in raw folder, > load it as resource then try to > > copy it into app path. It does not need to be inside /databases > > folder. It can be anywhere (SDcard not recommended) > > Why is copying onto the sdcard not recommeded? > > Pepijn -- 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: Installing APK + DB
thanK you guys, finallly I followed this link and works: www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ i had some problems with the package name, which throws in "error copying the database", and then with a table which wasn't found in the schema. it wasn't clear for me but i had to copy the sqlite file to the resources folder and also to the data/data/MYAPPL/database directory. anyway, i continuous without understanding why something that works in the emulator doesn't works in the real device WITHOUT CHANGES. finally it worked :-( NOW I HAVE ANOTHER PROBLEM :-( WHEN MY PHONE (SAMSUNG TAB) SWITCHS THE IMAGE FROM VERTICAL TO HORIZONTAL, THERE IS AN EXCEPTION THAT I DON'T KNOW HOW TO CATCH, AND THE APPL CRASH MAY SOMEBODY TELL ME WHATS GOING ON ? .. IS THERE SOMEWHERE AN EXAMPLE CODE TO DEAL WITH ? REGARDS ... On Jul 5, 7:15 am, Pepijn Van Eeckhoudt wrote: > On 04/07/2011 03:19, NikolaMKD wrote:> Save it as resource in raw folder, > load it as resource then try to > > copy it into app path. It does not need to be inside /databases > > folder. It can be anywhere (SDcard not recommended) > > Why is copying onto the sdcard not recommeded? > > Pepijn -- 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: Installing APK + DB
there is something i don't understand ... if the application works fine into the emulator: --- does not mean that it will work into de real device ? --- does not mean that the apk file is complete ... including the database ? --- directory: data/data/MYAPPL/databases is or not the right place for databases? regards On Jul 3, 8:19 pm, NikolaMKD wrote: > Save it as resource in raw folder, load it as resource then try to > copy it into app path. It does not need to be inside /databases > folder. It can be anywhere (SDcard not recommended) Thats how you ship > external SQLiteDatabase. Google it how to ship external sqlite > database android, there is sample codes (on one blog, i cant > remember), but they must be modified based on your app requirements. > They are just good for start. > > On Jul 4, 2:08 am, "hectordu...@yahoo.com" > wrote: > > > Mark, > > yes, i agree, the process is not right ... > > may you share with me a link which help me including my database into > > the apk file ? > > thanks in advance. > > > On 3 jul, 17:59, Mark Murphy wrote: > > > > On Sun, Jul 3, 2011 at 6:43 PM, hectordu...@yahoo.com > > > > wrote: > > > > I am trying to install my first ;-( Android application into a Samsung > > > > tab phone device but it does not start; i wonder if i am missig > > > > something in the process: > > > > > 1- Appl needs a pre-existing sqlite database, which i have installed > > > > (eclipse+DDS+pull) into my development environment ... so, it is > > > > installed under data/data/MYAPPL/databases/myDB.db > > > > > 2- the appl runs fine into the emulator > > > > > 3- i have conected my phone device, start adb and have seen my device: > > > > ./adb kill-server > > > > ./adb start-server > > > > ./adb devices > > > > > 4- i have installed (with sucess) my apk: > > > > ./adb install -l workspace/myAppl.apk > > > > > DOES THE APK FILE INCLUDES THE DB ? > > > > Not based on anything you have described here. You manually copied the > > > database to the device in step #1. That does not put the database > > > inside of the APK file, any more than copying a file to a Windows PC > > > automatically puts it inside an .MSI file. > > > > > 5- disconnect my device: > > > > ./adb kill-server > > > > + unpluged > > > > > BUT, THE APPLICATION DOES NOT START: > > > > ... "application has stopped unexpectedly ..." > > > > > I think the problem is related with the database; maybe it does not > > > > exist, but i am tryin to see waths going on ... may somebody help me ? > > > > Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine > > > LogCat and look at the stack trace associated with your error message. > > > > -- > > > Mark Murphy (a Commons > > > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > > > Warescription: Three Android Books, Plus Updates, One Low Price! -- 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: Installing APK + DB
Mark, yes, i agree, the process is not right ... may you share with me a link which help me including my database into the apk file ? thanks in advance. On 3 jul, 17:59, Mark Murphy wrote: > On Sun, Jul 3, 2011 at 6:43 PM, hectordu...@yahoo.com > > > > wrote: > > I am trying to install my first ;-( Android application into a Samsung > > tab phone device but it does not start; i wonder if i am missig > > something in the process: > > > 1- Appl needs a pre-existing sqlite database, which i have installed > > (eclipse+DDS+pull) into my development environment ... so, it is > > installed under data/data/MYAPPL/databases/myDB.db > > > 2- the appl runs fine into the emulator > > > 3- i have conected my phone device, start adb and have seen my device: > > ./adb kill-server > > ./adb start-server > > ./adb devices > > > 4- i have installed (with sucess) my apk: > > ./adb install -l workspace/myAppl.apk > > > DOES THE APK FILE INCLUDES THE DB ? > > Not based on anything you have described here. You manually copied the > database to the device in step #1. That does not put the database > inside of the APK file, any more than copying a file to a Windows PC > automatically puts it inside an .MSI file. > > > 5- disconnect my device: > > ./adb kill-server > > + unpluged > > > BUT, THE APPLICATION DOES NOT START: > > ... "application has stopped unexpectedly ..." > > > I think the problem is related with the database; maybe it does not > > exist, but i am tryin to see waths going on ... may somebody help me ? > > Use adb logcat, DDMS, or the DDMS perspective in Eclipse to examine > LogCat and look at the stack trace associated with your error message. > > -- > Mark Murphy (a Commons > Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy > > Warescription: Three Android Books, Plus Updates, One Low Price! -- 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] Installing APK + DB
hi guys, I am trying to install my first ;-( Android application into a Samsung tab phone device but it does not start; i wonder if i am missig something in the process: 1- Appl needs a pre-existing sqlite database, which i have installed (eclipse+DDS+pull) into my development environment ... so, it is installed under data/data/MYAPPL/databases/myDB.db 2- the appl runs fine into the emulator 3- i have conected my phone device, start adb and have seen my device: ./adb kill-server ./adb start-server ./adb devices 4- i have installed (with sucess) my apk: ./adb install -l workspace/myAppl.apk DOES THE APK FILE INCLUDES THE DB ? 5- disconnect my device: ./adb kill-server + unpluged BUT, THE APPLICATION DOES NOT START: ... "application has stopped unexpectedly ..." I think the problem is related with the database; maybe it does not exist, but i am tryin to see waths going on ... may somebody help me ? thanks in advance, Hector -- 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: STL android
"me doy el lapo!" difficult decition, but i have decided to port everything to java and get advantage of the android technology :-( i have realized that both, java and SQlite afford all the functionality i have been working with STL, and in the short time i can use all the pissibilities that android has, instead of been dealing each time with c/c++ and JNI :-) thanks you guys, for alll your comments ... On Jun 17, 11:58 am, "hectordu...@yahoo.com" wrote: > yeah! > i need to pass a pointer to a STL structure which is updated by each > user interaction :-( > I also have readen about NativeActivity but it also needs JNI in some > way ... and passing the STL structures will be a requirement, yet. > > I only can package data into an own streaming if there is a second > (concurrent) application runnning (implementing the STL > functionality). Is it possible ? > or .. does it nedd "natibe activity" > regards > > Hector > > Other pssibility > On Jun 17, 2:54 am, RichardC wrote: > > > I don't pass any STL structures across JNI, I pack/unpack just the > > data I need in to basic types or arrays of basic types, doing my own > > simple streaming as required. > > > My application is a board game with the next move calculator in C++ > > and the UI (and game state) in Java, so there is not much to transfer > > between the two layers. > > > If you have a lot of state you need to pass back and forth between C++ > > and Java I suggest you have a look at NativeActivity (I am just > > starting this myself - so I can be much help here). It looks like it > > by subclassing the Java NativeActivity class it should be possible to > > keep my entire engine (and it's state) in C++ and pass just the UI > > events across the JNI interface. I have not tried this yet - I can > > feel a test project coming on. > > > On Jun 16, 10:06 pm, "hectordu...@yahoo.com" > > wrote: > > > > hey Richard, thanks for helping ... in fact, i have installed SDK-NDK, > > > read the CPLUSPLUS-SUPPORT.html doc, and preparing to compile my C++ > > > STL stuff, but what i really am afraid is of JNI. There are interfaces > > > depending of the filed's types, and i dont realize how to pass STL > > > structures or pointers to them. I wonder if you have a kind of hello- > > > jni example which you can share in this thread ? > > > > kriss, i agree with you, but development time is a real constraint :- > > > ( > > > > On Jun 16, 3:25 pm, RichardC wrote: > > > > > Hi, > > > > > I have a big "lump" of STL code that is building sucessfully using the > > > > latest release of the Android-ndk (r5c). It just need a few tweaks. > > > > It is called from Java via JNI as needed. > > > > > I sugguest you download the > > > > NDK:http://developer.android.com/sdk/ndk/index.html > > > > > and read the docs specifically "CPLUSPLUS-SUPPORT.html" > > > > > If you have any questions I will try and help. > > > > > On Jun 16, 4:55 pm, "hectordu...@yahoo.com" > > > > wrote: > > > > > > hi guys, > > > > > I would like to migrate a c/c++ (linux fedora 14) application to > > > > > android 2.2. > > > > > Because this will be my first migration, i have some questions about > > > > > the procedure: > > > > > > 1. considering it has some STL stuff, i wonder if it will work. I > > > > > specially use vector, set, map and algoritms (set_union, > > > > > set_intersection, set_difference). > > > > > > 2. as i understand i have to write -first- a Java-JNI application > > > > > which declares and interface my c functions and c++ methods. Those > > > > > methods willl be included into one (or many) shared libraries ... is > > > > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > > > > like the ones i've found :-( > > > > > > 3- once ready, i must use the NDK toolset in order to generate the > > > > > android application ... hopefully i will works.. > > > > > > I am worried because the NDK info says to have a "A Minimal set of > > > > > headers for C++ support" ... and i wonder if STL works or not ... > > > > > but, NDK r5 - android - suposse to also hav support for STLport ... > > > > > does any body has the hello-jni file modifyied for STL suppport ? > > > > > > NDK Doc also
[android-developers] Re: STL android
yeah! i need to pass a pointer to a STL structure which is updated by each user interaction :-( I also have readen about NativeActivity but it also needs JNI in some way ... and passing the STL structures will be a requirement, yet. I only can package data into an own streaming if there is a second (concurrent) application runnning (implementing the STL functionality). Is it possible ? or .. does it nedd "natibe activity" regards Hector Other pssibility On Jun 17, 2:54 am, RichardC wrote: > I don't pass any STL structures across JNI, I pack/unpack just the > data I need in to basic types or arrays of basic types, doing my own > simple streaming as required. > > My application is a board game with the next move calculator in C++ > and the UI (and game state) in Java, so there is not much to transfer > between the two layers. > > If you have a lot of state you need to pass back and forth between C++ > and Java I suggest you have a look at NativeActivity (I am just > starting this myself - so I can be much help here). It looks like it > by subclassing the Java NativeActivity class it should be possible to > keep my entire engine (and it's state) in C++ and pass just the UI > events across the JNI interface. I have not tried this yet - I can > feel a test project coming on. > > On Jun 16, 10:06 pm, "hectordu...@yahoo.com" > wrote: > > > hey Richard, thanks for helping ... in fact, i have installed SDK-NDK, > > read the CPLUSPLUS-SUPPORT.html doc, and preparing to compile my C++ > > STL stuff, but what i really am afraid is of JNI. There are interfaces > > depending of the filed's types, and i dont realize how to pass STL > > structures or pointers to them. I wonder if you have a kind of hello- > > jni example which you can share in this thread ? > > > kriss, i agree with you, but development time is a real constraint :- > > ( > > > On Jun 16, 3:25 pm, RichardC wrote: > > > > Hi, > > > > I have a big "lump" of STL code that is building sucessfully using the > > > latest release of the Android-ndk (r5c). It just need a few tweaks. > > > It is called from Java via JNI as needed. > > > > I sugguest you download the > > > NDK:http://developer.android.com/sdk/ndk/index.html > > > > and read the docs specifically "CPLUSPLUS-SUPPORT.html" > > > > If you have any questions I will try and help. > > > > On Jun 16, 4:55 pm, "hectordu...@yahoo.com" > > > wrote: > > > > > hi guys, > > > > I would like to migrate a c/c++ (linux fedora 14) application to > > > > android 2.2. > > > > Because this will be my first migration, i have some questions about > > > > the procedure: > > > > > 1. considering it has some STL stuff, i wonder if it will work. I > > > > specially use vector, set, map and algoritms (set_union, > > > > set_intersection, set_difference). > > > > > 2. as i understand i have to write -first- a Java-JNI application > > > > which declares and interface my c functions and c++ methods. Those > > > > methods willl be included into one (or many) shared libraries ... is > > > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > > > like the ones i've found :-( > > > > > 3- once ready, i must use the NDK toolset in order to generate the > > > > android application ... hopefully i will works.. > > > > > I am worried because the NDK info says to have a "A Minimal set of > > > > headers for C++ support" ... and i wonder if STL works or not ... > > > > but, NDK r5 - android - suposse to also hav support for STLport ... > > > > does any body has the hello-jni file modifyied for STL suppport ? > > > > > NDK Doc also says that "Applications that use native activities must > > > > be run on Android 2.3 (API Level 9) or later", but as i understand, i > > > > will also needs JNI .. may somebody make some comments about it ? > > > > > finally, may somebody share me a JNI example in order to pass some STL > > > > functions between java and c++ ? > > > > > comments are wellcome. > > > > > regards, thanks in advance > > > > > hector -- 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: STL android
yeah! i need to pass a pointer to a STL structure which is updated by each user interaction :-( I also have readen about NativeActivity but it also needs JNI in some way ... and passing the STL structures will be a requirement, yet. I only can package data into an own streaming if there is a second (concurrent) application runnning (implementing the STL functionality). Is it possible ? or .. does it nedd "natibe activity" regards Hector Other pssibility On Jun 17, 2:54 am, RichardC wrote: > I don't pass any STL structures across JNI, I pack/unpack just the > data I need in to basic types or arrays of basic types, doing my own > simple streaming as required. > > My application is a board game with the next move calculator in C++ > and the UI (and game state) in Java, so there is not much to transfer > between the two layers. > > If you have a lot of state you need to pass back and forth between C++ > and Java I suggest you have a look at NativeActivity (I am just > starting this myself - so I can be much help here). It looks like it > by subclassing the Java NativeActivity class it should be possible to > keep my entire engine (and it's state) in C++ and pass just the UI > events across the JNI interface. I have not tried this yet - I can > feel a test project coming on. > > On Jun 16, 10:06 pm, "hectordu...@yahoo.com" > wrote: > > > hey Richard, thanks for helping ... in fact, i have installed SDK-NDK, > > read the CPLUSPLUS-SUPPORT.html doc, and preparing to compile my C++ > > STL stuff, but what i really am afraid is of JNI. There are interfaces > > depending of the filed's types, and i dont realize how to pass STL > > structures or pointers to them. I wonder if you have a kind of hello- > > jni example which you can share in this thread ? > > > kriss, i agree with you, but development time is a real constraint :- > > ( > > > On Jun 16, 3:25 pm, RichardC wrote: > > > > Hi, > > > > I have a big "lump" of STL code that is building sucessfully using the > > > latest release of the Android-ndk (r5c). It just need a few tweaks. > > > It is called from Java via JNI as needed. > > > > I sugguest you download the > > > NDK:http://developer.android.com/sdk/ndk/index.html > > > > and read the docs specifically "CPLUSPLUS-SUPPORT.html" > > > > If you have any questions I will try and help. > > > > On Jun 16, 4:55 pm, "hectordu...@yahoo.com" > > > wrote: > > > > > hi guys, > > > > I would like to migrate a c/c++ (linux fedora 14) application to > > > > android 2.2. > > > > Because this will be my first migration, i have some questions about > > > > the procedure: > > > > > 1. considering it has some STL stuff, i wonder if it will work. I > > > > specially use vector, set, map and algoritms (set_union, > > > > set_intersection, set_difference). > > > > > 2. as i understand i have to write -first- a Java-JNI application > > > > which declares and interface my c functions and c++ methods. Those > > > > methods willl be included into one (or many) shared libraries ... is > > > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > > > like the ones i've found :-( > > > > > 3- once ready, i must use the NDK toolset in order to generate the > > > > android application ... hopefully i will works.. > > > > > I am worried because the NDK info says to have a "A Minimal set of > > > > headers for C++ support" ... and i wonder if STL works or not ... > > > > but, NDK r5 - android - suposse to also hav support for STLport ... > > > > does any body has the hello-jni file modifyied for STL suppport ? > > > > > NDK Doc also says that "Applications that use native activities must > > > > be run on Android 2.3 (API Level 9) or later", but as i understand, i > > > > will also needs JNI .. may somebody make some comments about it ? > > > > > finally, may somebody share me a JNI example in order to pass some STL > > > > functions between java and c++ ? > > > > > comments are wellcome. > > > > > regards, thanks in advance > > > > > hector -- 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: STL android
yeah! i need to pass a pointer to a STL structure which is updated by each user interaction :-( I also have readen about NativeActivity but it also needs JNI in some way ... and passing the STL structures will be a requirement, yet. I only can package data into an own streaming if there is a second (concurrent) application runnning (implementing the STL functionality). Is it possible ? or .. does it nedd "natibe activity" regards Hector Other pssibility On Jun 17, 2:54 am, RichardC wrote: > I don't pass any STL structures across JNI, I pack/unpack just the > data I need in to basic types or arrays of basic types, doing my own > simple streaming as required. > > My application is a board game with the next move calculator in C++ > and the UI (and game state) in Java, so there is not much to transfer > between the two layers. > > If you have a lot of state you need to pass back and forth between C++ > and Java I suggest you have a look at NativeActivity (I am just > starting this myself - so I can be much help here). It looks like it > by subclassing the Java NativeActivity class it should be possible to > keep my entire engine (and it's state) in C++ and pass just the UI > events across the JNI interface. I have not tried this yet - I can > feel a test project coming on. > > On Jun 16, 10:06 pm, "hectordu...@yahoo.com" > wrote: > > > hey Richard, thanks for helping ... in fact, i have installed SDK-NDK, > > read the CPLUSPLUS-SUPPORT.html doc, and preparing to compile my C++ > > STL stuff, but what i really am afraid is of JNI. There are interfaces > > depending of the filed's types, and i dont realize how to pass STL > > structures or pointers to them. I wonder if you have a kind of hello- > > jni example which you can share in this thread ? > > > kriss, i agree with you, but development time is a real constraint :- > > ( > > > On Jun 16, 3:25 pm, RichardC wrote: > > > > Hi, > > > > I have a big "lump" of STL code that is building sucessfully using the > > > latest release of the Android-ndk (r5c). It just need a few tweaks. > > > It is called from Java via JNI as needed. > > > > I sugguest you download the > > > NDK:http://developer.android.com/sdk/ndk/index.html > > > > and read the docs specifically "CPLUSPLUS-SUPPORT.html" > > > > If you have any questions I will try and help. > > > > On Jun 16, 4:55 pm, "hectordu...@yahoo.com" > > > wrote: > > > > > hi guys, > > > > I would like to migrate a c/c++ (linux fedora 14) application to > > > > android 2.2. > > > > Because this will be my first migration, i have some questions about > > > > the procedure: > > > > > 1. considering it has some STL stuff, i wonder if it will work. I > > > > specially use vector, set, map and algoritms (set_union, > > > > set_intersection, set_difference). > > > > > 2. as i understand i have to write -first- a Java-JNI application > > > > which declares and interface my c functions and c++ methods. Those > > > > methods willl be included into one (or many) shared libraries ... is > > > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > > > like the ones i've found :-( > > > > > 3- once ready, i must use the NDK toolset in order to generate the > > > > android application ... hopefully i will works.. > > > > > I am worried because the NDK info says to have a "A Minimal set of > > > > headers for C++ support" ... and i wonder if STL works or not ... > > > > but, NDK r5 - android - suposse to also hav support for STLport ... > > > > does any body has the hello-jni file modifyied for STL suppport ? > > > > > NDK Doc also says that "Applications that use native activities must > > > > be run on Android 2.3 (API Level 9) or later", but as i understand, i > > > > will also needs JNI .. may somebody make some comments about it ? > > > > > finally, may somebody share me a JNI example in order to pass some STL > > > > functions between java and c++ ? > > > > > comments are wellcome. > > > > > regards, thanks in advance > > > > > hector -- 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: STL android
yeah! i need to pass a pointer to a STL structure which is updated by each user interaction :-( I also have readen about NativeActivity but it also needs JNI in some way ... and passing the STL structures will be a requirement, yet. I only can package data into an own streaming if there is a second (concurrent) application runnning (implementing the STL functionality). Is it possible ? or .. does it nedd "natibe activity" regards Hector Other pssibility On Jun 17, 2:54 am, RichardC wrote: > I don't pass any STL structures across JNI, I pack/unpack just the > data I need in to basic types or arrays of basic types, doing my own > simple streaming as required. > > My application is a board game with the next move calculator in C++ > and the UI (and game state) in Java, so there is not much to transfer > between the two layers. > > If you have a lot of state you need to pass back and forth between C++ > and Java I suggest you have a look at NativeActivity (I am just > starting this myself - so I can be much help here). It looks like it > by subclassing the Java NativeActivity class it should be possible to > keep my entire engine (and it's state) in C++ and pass just the UI > events across the JNI interface. I have not tried this yet - I can > feel a test project coming on. > > On Jun 16, 10:06 pm, "hectordu...@yahoo.com" > wrote: > > > hey Richard, thanks for helping ... in fact, i have installed SDK-NDK, > > read the CPLUSPLUS-SUPPORT.html doc, and preparing to compile my C++ > > STL stuff, but what i really am afraid is of JNI. There are interfaces > > depending of the filed's types, and i dont realize how to pass STL > > structures or pointers to them. I wonder if you have a kind of hello- > > jni example which you can share in this thread ? > > > kriss, i agree with you, but development time is a real constraint :- > > ( > > > On Jun 16, 3:25 pm, RichardC wrote: > > > > Hi, > > > > I have a big "lump" of STL code that is building sucessfully using the > > > latest release of the Android-ndk (r5c). It just need a few tweaks. > > > It is called from Java via JNI as needed. > > > > I sugguest you download the > > > NDK:http://developer.android.com/sdk/ndk/index.html > > > > and read the docs specifically "CPLUSPLUS-SUPPORT.html" > > > > If you have any questions I will try and help. > > > > On Jun 16, 4:55 pm, "hectordu...@yahoo.com" > > > wrote: > > > > > hi guys, > > > > I would like to migrate a c/c++ (linux fedora 14) application to > > > > android 2.2. > > > > Because this will be my first migration, i have some questions about > > > > the procedure: > > > > > 1. considering it has some STL stuff, i wonder if it will work. I > > > > specially use vector, set, map and algoritms (set_union, > > > > set_intersection, set_difference). > > > > > 2. as i understand i have to write -first- a Java-JNI application > > > > which declares and interface my c functions and c++ methods. Those > > > > methods willl be included into one (or many) shared libraries ... is > > > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > > > like the ones i've found :-( > > > > > 3- once ready, i must use the NDK toolset in order to generate the > > > > android application ... hopefully i will works.. > > > > > I am worried because the NDK info says to have a "A Minimal set of > > > > headers for C++ support" ... and i wonder if STL works or not ... > > > > but, NDK r5 - android - suposse to also hav support for STLport ... > > > > does any body has the hello-jni file modifyied for STL suppport ? > > > > > NDK Doc also says that "Applications that use native activities must > > > > be run on Android 2.3 (API Level 9) or later", but as i understand, i > > > > will also needs JNI .. may somebody make some comments about it ? > > > > > finally, may somebody share me a JNI example in order to pass some STL > > > > functions between java and c++ ? > > > > > comments are wellcome. > > > > > regards, thanks in advance > > > > > hector -- 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: STL android
hey Richard, thanks for helping ... in fact, i have installed SDK-NDK, read the CPLUSPLUS-SUPPORT.html doc, and preparing to compile my C++ STL stuff, but what i really am afraid is of JNI. There are interfaces depending of the filed's types, and i dont realize how to pass STL structures or pointers to them. I wonder if you have a kind of hello- jni example which you can share in this thread ? kriss, i agree with you, but development time is a real constraint :- ( On Jun 16, 3:25 pm, RichardC wrote: > Hi, > > I have a big "lump" of STL code that is building sucessfully using the > latest release of the Android-ndk (r5c). It just need a few tweaks. > It is called from Java via JNI as needed. > > I sugguest you download the > NDK:http://developer.android.com/sdk/ndk/index.html > > and read the docs specifically "CPLUSPLUS-SUPPORT.html" > > If you have any questions I will try and help. > > On Jun 16, 4:55 pm, "hectordu...@yahoo.com" > wrote: > > > hi guys, > > I would like to migrate a c/c++ (linux fedora 14) application to > > android 2.2. > > Because this will be my first migration, i have some questions about > > the procedure: > > > 1. considering it has some STL stuff, i wonder if it will work. I > > specially use vector, set, map and algoritms (set_union, > > set_intersection, set_difference). > > > 2. as i understand i have to write -first- a Java-JNI application > > which declares and interface my c functions and c++ methods. Those > > methods willl be included into one (or many) shared libraries ... is > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > like the ones i've found :-( > > > 3- once ready, i must use the NDK toolset in order to generate the > > android application ... hopefully i will works.. > > > I am worried because the NDK info says to have a "A Minimal set of > > headers for C++ support" ... and i wonder if STL works or not ... > > but, NDK r5 - android - suposse to also hav support for STLport ... > > does any body has the hello-jni file modifyied for STL suppport ? > > > NDK Doc also says that "Applications that use native activities must > > be run on Android 2.3 (API Level 9) or later", but as i understand, i > > will also needs JNI .. may somebody make some comments about it ? > > > finally, may somebody share me a JNI example in order to pass some STL > > functions between java and c++ ? > > > comments are wellcome. > > > regards, thanks in advance > > > hector -- 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: STL android
kris, what is the java equivalent to stl (c++) ? i agree, if easy, i would prefere to port it :-(...and to avooid JNI... On Jun 16, 2:28 pm, Kristopher Micinski wrote: > Unfortunately if you're doing heavy computing, it might *not* make sense. > This is typically the quickest way to kill the battery, and your > application probably is not structured to fit the android specifics. (For > example, what happens if your app is killed after running for a while? This > doesn't happen in linux, but certainly happens on Android.) > > You'll have to use the NDK-JNI if you want to keep any of your c++ code. > How much do you have? Rough estimate? > > You don't have access to the "old world" unix IPC, mostly because of > restrictions imposed for security reasons. > > Difficulty of porting c++/stl to Java should be minimal. It will take time, > but the languages are fairly similar. The thing that will really take time > is restructuring your application to work within the Android process model, > which might require a methodology change depending on your apps structure. > I'm trusting that if your code is complex enough you won't give away what > it does, then you shouldn't have any trouble learning to port it :o)... > > Kris > > On Thu, Jun 16, 2011 at 3:17 PM, hectordu...@yahoo.com < > > hectordu...@yahoo.com> wrote: > > hello Kris, thanks for answering. > > Well ... in my case it makes sense :-( but i don want to go into > > functionality details. Fact is that i have a c/c++(STL) application > > which makes some computations :-( and i need it to communicate in any > > way with a java-androide aplication which will be the UI: one option > > is NDK-JNI but if possible, i would like to avoid JNI. I wonder, may i > > run my c++(STL) appl concurrently with the java UI and communicate > > both of them in order to change some basic information? .. sockets ... > > pipes ... other .. without JNI ? > > > any way, a NDK-JNI-c++-STL example will be very welcome, if any one of > > you guys may share it .. > > > and, by the way, how can i port (easy) C++/STL to java ??? > > > On Jun 16, 1:51 pm, Kristopher Micinski > > wrote: > > > What application are you trying to migrate? > > > > Android is different enough, that you will probably be better off > > rewriting > > > the application in the SDK framework. > > > > The NDK wasn't designed to write whole applications, depending on how > > large > > > your app is it might be better to rewrite the whole thing. But perhaps > > > another solution is to keep what you can, and change what you need. > > > > In any case, most of the time, dropping a few thousand lines of c++ into > > a > > > mobile environment just doesn't make sense (i.e., the environment is > > > different enough that structuring your app different might really be > > needed, > > > and if it's a batch processing app it might not make sense to perform > > some > > > of the operations in a mobile environment...) > > > > Kris > > > > On Thu, Jun 16, 2011 at 11:55 AM, hectordu...@yahoo.com < > > > > hectordu...@yahoo.com> wrote: > > > > hi guys, > > > > I would like to migrate a c/c++ (linux fedora 14) application to > > > > android 2.2. > > > > Because this will be my first migration, i have some questions about > > > > the procedure: > > > > > 1. considering it has some STL stuff, i wonder if it will work. I > > > > specially use vector, set, map and algoritms (set_union, > > > > set_intersection, set_difference). > > > > > 2. as i understand i have to write -first- a Java-JNI application > > > > which declares and interface my c functions and c++ methods. Those > > > > methods willl be included into one (or many) shared libraries ... is > > > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > > > like the ones i've found :-( > > > > > 3- once ready, i must use the NDK toolset in order to generate the > > > > android application ... hopefully i will works.. > > > > > I am worried because the NDK info says to have a "A Minimal set of > > > > headers for C++ support" ... and i wonder if STL works or not ... > > > > but, NDK r5 - android - suposse to also hav support for STLport ... > > > > does any body has the hello-jni file modifyied for STL suppport ? > > > > > NDK Doc also says that "Applications that use nat
[android-developers] Re: STL android
hello Kris, thanks for answering. Well ... in my case it makes sense :-( but i don want to go into functionality details. Fact is that i have a c/c++(STL) application which makes some computations :-( and i need it to communicate in any way with a java-androide aplication which will be the UI: one option is NDK-JNI but if possible, i would like to avoid JNI. I wonder, may i run my c++(STL) appl concurrently with the java UI and communicate both of them in order to change some basic information? .. sockets ... pipes ... other .. without JNI ? any way, a NDK-JNI-c++-STL example will be very welcome, if any one of you guys may share it .. and, by the way, how can i port (easy) C++/STL to java ??? On Jun 16, 1:51 pm, Kristopher Micinski wrote: > What application are you trying to migrate? > > Android is different enough, that you will probably be better off rewriting > the application in the SDK framework. > > The NDK wasn't designed to write whole applications, depending on how large > your app is it might be better to rewrite the whole thing. But perhaps > another solution is to keep what you can, and change what you need. > > In any case, most of the time, dropping a few thousand lines of c++ into a > mobile environment just doesn't make sense (i.e., the environment is > different enough that structuring your app different might really be needed, > and if it's a batch processing app it might not make sense to perform some > of the operations in a mobile environment...) > > Kris > > On Thu, Jun 16, 2011 at 11:55 AM, hectordu...@yahoo.com < > > hectordu...@yahoo.com> wrote: > > hi guys, > > I would like to migrate a c/c++ (linux fedora 14) application to > > android 2.2. > > Because this will be my first migration, i have some questions about > > the procedure: > > > 1. considering it has some STL stuff, i wonder if it will work. I > > specially use vector, set, map and algoritms (set_union, > > set_intersection, set_difference). > > > 2. as i understand i have to write -first- a Java-JNI application > > which declares and interface my c functions and c++ methods. Those > > methods willl be included into one (or many) shared libraries ... is > > it ok ? ... may somebody advise me a good JNI tutorial ? ... i don > > like the ones i've found :-( > > > 3- once ready, i must use the NDK toolset in order to generate the > > android application ... hopefully i will works.. > > > I am worried because the NDK info says to have a "A Minimal set of > > headers for C++ support" ... and i wonder if STL works or not ... > > but, NDK r5 - android - suposse to also hav support for STLport ... > > does any body has the hello-jni file modifyied for STL suppport ? > > > NDK Doc also says that "Applications that use native activities must > > be run on Android 2.3 (API Level 9) or later", but as i understand, i > > will also needs JNI .. may somebody make some comments about it ? > > > finally, may somebody share me a JNI example in order to pass some STL > > functions between java and c++ ? > > > comments are wellcome. > > > regards, thanks in advance > > > hector > > > -- > > 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
[android-developers] STL android
hi guys, I would like to migrate a c/c++ (linux fedora 14) application to android 2.2. Because this will be my first migration, i have some questions about the procedure: 1. considering it has some STL stuff, i wonder if it will work. I specially use vector, set, map and algoritms (set_union, set_intersection, set_difference). 2. as i understand i have to write -first- a Java-JNI application which declares and interface my c functions and c++ methods. Those methods willl be included into one (or many) shared libraries ... is it ok ? ... may somebody advise me a good JNI tutorial ? ... i don like the ones i've found :-( 3- once ready, i must use the NDK toolset in order to generate the android application ... hopefully i will works.. I am worried because the NDK info says to have a "A Minimal set of headers for C++ support" ... and i wonder if STL works or not ... but, NDK r5 - android - suposse to also hav support for STLport ... does any body has the hello-jni file modifyied for STL suppport ? NDK Doc also says that "Applications that use native activities must be run on Android 2.3 (API Level 9) or later", but as i understand, i will also needs JNI .. may somebody make some comments about it ? finally, may somebody share me a JNI example in order to pass some STL functions between java and c++ ? comments are wellcome. regards, thanks in advance hector -- 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