[android-developers] How to dump a Sqlite statements txt file into db.
Hi, I am preparing a new update of my appliction, in this version I need to insert lot of new rows (200) in my db. Because I don't want to programatically add 200 insert code line for each row, I would like to know what is the best method to accomplish it just with a call to the file and dumping it into my db. Regards. -- 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: How to import the License Verification Library into workspace?
If I use the "Existing project into Workspace" option then the project gets this error: "The import android.os can not to be resolved" I suposse it's because it's not an Android project. On Oct 19, 1:52 pm, "jlopeznava...@gmail.com" wrote: > There is no such option in "Import". Just "Existing Projects into > Workspace". > > On Oct 19, 1:04 pm, damodhar meshran wrote: > > > > > see there other option available chose other and the select android project > > > On Tue, Oct 19, 2010 at 2:09 PM, jlopeznava...@gmail.com < > > > jlopeznava...@gmail.com> wrote: > > > I can't import the License Verification Library to the workspace. In > > > the Eclipse wizard I click "File > import" but no Android option > > > available, if I choose normal Java project then it doesn't work > > > because it has no Android api reference. How to do? > > > > Thanks in advance. > > > > -- > > > 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 > > cr...@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: How to import the License Verification Library into workspace?
There is no such option in "Import". Just "Existing Projects into Workspace". On Oct 19, 1:04 pm, damodhar meshran wrote: > see there other option available chose other and the select android project > > On Tue, Oct 19, 2010 at 2:09 PM, jlopeznava...@gmail.com < > > > > jlopeznava...@gmail.com> wrote: > > I can't import the License Verification Library to the workspace. In > > the Eclipse wizard I click "File > import" but no Android option > > available, if I choose normal Java project then it doesn't work > > because it has no Android api reference. How to do? > > > Thanks in advance. > > > -- > > 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 > cr...@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] How to import the License Verification Library into workspace?
I can't import the License Verification Library to the workspace. In the Eclipse wizard I click "File > import" but no Android option available, if I choose normal Java project then it doesn't work because it has no Android api reference. How to do? Thanks in advance. -- 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: How to emulate onUpgrade call in SQLiteOpenHelper?
Thanks to Kostya and Kumar for help. I found the problem. I was opening database this way: String myPath = DB_PATH + DB_NAME; myDataBase = SQLiteDatabase.openDatabase(myPath, null, SQLiteDatabase.OPEN_READWRITE); This call doesn't result in a onCreate or onUpdate call. Instead that I have to use: myDataBase = this.getWritableDatabase(); getWritableDatabase and getReadableDatabase fire the onCreate and onUpdate events. Cheers. On Oct 17, 9:14 pm, Kostya Vasilyev wrote: > Your SQL open helper probably has something like: > > private static final int DATABASE_VERSION = 1; > > used like this (funky emphasis mine): > > public YourDbOpenHelper(Context context) { > super(context, DATABASE_NAME, null, [[[--->>> DATABASE_VERSION > <<<---]]]); > } > > The database version value is stored inside the SQLite database, and is > compared to the value in your code. If the value in the code is greater, > your onUpgrade is called. This logic is contained in the > SQLiteOpenHelper constructror (the call to "super" above). > > So, to test your onUpgrade, first run your application and make sure > that database is opened. This will store "1" (or whatever current value > of the constant is) as the database version. > > Now increment the version number to a greater value than used before. > Then run your application, and make sure you work with the database. > > It's not necessary to use "adb install", just running from Eclipse for > debugging, as usual, will work fine. > > -- Kostya > > 17.10.2010 22:36, Kumar Bibek ?: > > > > > > > I haven't tried to debug this. Most of the DB upgrades will simple > > enough, which didn't need explicit debugging. But, it works. I am sure > > it works on the emulator, and it should work on the device as well. > > > On Mon, Oct 18, 2010 at 12:02 AM, jlopeznava...@gmail.com > > <mailto:jlopeznava...@gmail.com> > <mailto:jlopeznava...@gmail.com>> wrote: > > > Not working for me :( I am stuck. > > Thanks anyway. > > > If I use the mobile device I can't use adb install because it says its > > installed. If I use the -r parameter with adb install it make a new > > installation from scratch so no upgrade event is fired. > > Have you ever tried to do with the device not with the emulator? > > > On Oct 17, 8:20 pm, Kumar Bibek > <mailto:coomar@gmail.com>> wrote: > > > This method will be executed whenever your try to initiate a DB > > connection. > > > Try executing a code which does some DB related task. > > > > On Sun, Oct 17, 2010 at 11:47 PM, jlopeznava...@gmail.com > > <mailto:jlopeznava...@gmail.com> < > > > > jlopeznava...@gmail.com <mailto:jlopeznava...@gmail.com>> wrote: > > > > Thanks for response. > > > > I am trying but I don't success. > > > > > What I do is: > > > > -Open eclipse, set a break point inside onUpgrade event > > > > -Run emulator. > > > > -In a windows prompt I type: > > > > adb emu install muPackage.apk > > > > > It runs, and it stop in the constructor but not in onUpgrade > > event, > > > > what am I missing? > > > > > On Oct 17, 6:53 pm, Kumar Bibek > <mailto:coomar@gmail.com>> wrote: > > > > > You can do it thru adb install command > > > > > > On Sun, Oct 17, 2010 at 10:15 PM, jlopeznava...@gmail.com > > <mailto:jlopeznava...@gmail.com> < > > > > > > jlopeznava...@gmail.com <mailto:jlopeznava...@gmail.com>> wrote: > > > > > > How to install the new apk over the older version? > > > > > > > On Oct 17, 6:34 pm, Kumar Bibek > <mailto:coomar@gmail.com>> wrote: > > > > > > > You just need to increment the database version number. > > Install the > > > > new > > > > > > apk > > > > > > > over the older version. It will be called just once. > > > > > > > > On Sun, Oct 17, 2010 at 10:02 PM, > > jlopeznava...@gmail.com <mailto:jlopeznava...@gmail.com> < > > > > > > > > jlopeznava...@gmail.com > > <mailto:jlopeznava...@gmail.com>> wrote: > > > > > > > > Hi, how can I emulate an onUpgrade call for my > > SQLiteOpenHelper > > > > class? >
[android-developers] Re: How to emulate onUpgrade call in SQLiteOpenHelper?
Not working for me :( I am stuck. Thanks anyway. If I use the mobile device I can't use adb install because it says its installed. If I use the -r parameter with adb install it make a new installation from scratch so no upgrade event is fired. Have you ever tried to do with the device not with the emulator? On Oct 17, 8:20 pm, Kumar Bibek wrote: > This method will be executed whenever your try to initiate a DB connection. > Try executing a code which does some DB related task. > > On Sun, Oct 17, 2010 at 11:47 PM, jlopeznava...@gmail.com < > > > > > > jlopeznava...@gmail.com> wrote: > > Thanks for response. > > I am trying but I don't success. > > > What I do is: > > -Open eclipse, set a break point inside onUpgrade event > > -Run emulator. > > -In a windows prompt I type: > > adb emu install muPackage.apk > > > It runs, and it stop in the constructor but not in onUpgrade event, > > what am I missing? > > > On Oct 17, 6:53 pm, Kumar Bibek wrote: > > > You can do it thru adb install command > > > > On Sun, Oct 17, 2010 at 10:15 PM, jlopeznava...@gmail.com < > > > > jlopeznava...@gmail.com> wrote: > > > > How to install the new apk over the older version? > > > > > On Oct 17, 6:34 pm, Kumar Bibek wrote: > > > > > You just need to increment the database version number. Install the > > new > > > > apk > > > > > over the older version. It will be called just once. > > > > > > On Sun, Oct 17, 2010 at 10:02 PM, jlopeznava...@gmail.com < > > > > > > jlopeznava...@gmail.com> wrote: > > > > > > Hi, how can I emulate an onUpgrade call for my SQLiteOpenHelper > > class? > > > > > > I have tried changing the version number in my SQLiteOpenHelper > > class > > > > > > and versionCode in manifest but onUpgrade is not called. > > > > > > Any idea? I need to check my onUpgrade code before upload it to the > > > > > > market, I don't want my app's users get a buggy upgrade. > > > > > > > Thanks in advance. > > > > > > > -- > > > > > > 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 > > > > > cr...@googlegroups.com> > cr...@googlegroups.com> > > > cr...@googlegroups.com> > > > > > > For more options, visit this group at > > > > > >http://groups.google.com/group/android-developers?hl=en > > > > > > -- > > > > > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 > > > cr...@googlegroups.com> > cr...@googlegroups.com> > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en > > > > -- > > > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to emulate onUpgrade call in SQLiteOpenHelper?
Thanks for response. I am trying but I don't success. What I do is: -Open eclipse, set a break point inside onUpgrade event -Run emulator. -In a windows prompt I type: adb emu install muPackage.apk It runs, and it stop in the constructor but not in onUpgrade event, what am I missing? On Oct 17, 6:53 pm, Kumar Bibek wrote: > You can do it thru adb install command > > On Sun, Oct 17, 2010 at 10:15 PM, jlopeznava...@gmail.com < > > > > > > jlopeznava...@gmail.com> wrote: > > How to install the new apk over the older version? > > > On Oct 17, 6:34 pm, Kumar Bibek wrote: > > > You just need to increment the database version number. Install the new > > apk > > > over the older version. It will be called just once. > > > > On Sun, Oct 17, 2010 at 10:02 PM, jlopeznava...@gmail.com < > > > > jlopeznava...@gmail.com> wrote: > > > > Hi, how can I emulate an onUpgrade call for my SQLiteOpenHelper class? > > > > I have tried changing the version number in my SQLiteOpenHelper class > > > > and versionCode in manifest but onUpgrade is not called. > > > > Any idea? I need to check my onUpgrade code before upload it to the > > > > market, I don't want my app's users get a buggy upgrade. > > > > > Thanks in advance. > > > > > -- > > > > 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 > > > cr...@googlegroups.com> > cr...@googlegroups.com> > > > > For more options, visit this group at > > > >http://groups.google.com/group/android-developers?hl=en > > > > -- > > > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to emulate onUpgrade call in SQLiteOpenHelper?
How to install the new apk over the older version? On Oct 17, 6:34 pm, Kumar Bibek wrote: > You just need to increment the database version number. Install the new apk > over the older version. It will be called just once. > > On Sun, Oct 17, 2010 at 10:02 PM, jlopeznava...@gmail.com < > > > > > > jlopeznava...@gmail.com> wrote: > > Hi, how can I emulate an onUpgrade call for my SQLiteOpenHelper class? > > I have tried changing the version number in my SQLiteOpenHelper class > > and versionCode in manifest but onUpgrade is not called. > > Any idea? I need to check my onUpgrade code before upload it to the > > market, I don't want my app's users get a buggy upgrade. > > > Thanks in advance. > > > -- > > 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 > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: How to emulate onUpgrade call in SQLiteOpenHelper?
How to install the new apk over the older version? On Oct 17, 6:34 pm, Kumar Bibek wrote: > You just need to increment the database version number. Install the new apk > over the older version. It will be called just once. > > On Sun, Oct 17, 2010 at 10:02 PM, jlopeznava...@gmail.com < > > > > > > jlopeznava...@gmail.com> wrote: > > Hi, how can I emulate an onUpgrade call for my SQLiteOpenHelper class? > > I have tried changing the version number in my SQLiteOpenHelper class > > and versionCode in manifest but onUpgrade is not called. > > Any idea? I need to check my onUpgrade code before upload it to the > > market, I don't want my app's users get a buggy upgrade. > > > Thanks in advance. > > > -- > > 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 > cr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.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 at http://groups.google.com/group/android-developers?hl=en
[android-developers] How to emulate onUpgrade call in SQLiteOpenHelper?
Hi, how can I emulate an onUpgrade call for my SQLiteOpenHelper class? I have tried changing the version number in my SQLiteOpenHelper class and versionCode in manifest but onUpgrade is not called. Any idea? I need to check my onUpgrade code before upload it to the market, I don't want my app's users get a buggy upgrade. Thanks in advance. -- 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] Strabge behaviour in ListView with single choice mode
Hi, I have a ListView with 4 rows and I want to color the text inside each row when a row is clicked, the code below works fine but if I change the selection mode of the ListView to single mode the View object received is not the correct one. In this case : if I click row number 1 it colors the 4th if I click row number 2 it colors the 3th if I click row number 3 it colors the second if I click row number 4 it colors the first Any idea about waht is happening??? @Override protected void onListItemClick(ListView listView, View v, int position, long id) { super.onListItemClick(listView, v, position, id); //This loop works fine //Clean the text color of all rows for (int conta = 0; conta < (listView.getCount() ); conta ++) { View objView = listView.getChildAt(conta); if (objView != null) { TextView tvLetraRespuesta = (TextView) objView.findViewById(R.id.tvLetraRespuesta); tvLetraRespuesta.setTextColor(0xFFDD); //default color } } //This piece of code gets wrong in single mode //Set the text color for the selected row TextView tvLetraRespuesta = (TextView) v.findViewById(R.id.tvLetraRespuesta);//here is the problem? if (tvLetraRespuesta != null) { tvLetraRespuesta.setTextColor(0xFF00); //Row selected text color } } -- 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: scrollbarAlwaysDrawVerticalTrack doesn't work with ListView
Ok, thanks for the tip. On Sep 30, 6:50 pm, Romain Guy wrote: > The track is not the scrollbar, the track is what the scrollbar > "slides" into. The default theme does not have a track anymore. The > track is normally shown only when the view can scroll and this > attribute can be used to show the track even when you can't scroll. In > your case I believe you want to disable scrollbars fading instead. Or > you should provide your own scrollbar track drawable. > > On Thu, Sep 30, 2010 at 8:10 AM, jlopeznava...@gmail.com > > > > > > wrote: > > Hi, I have a ListView and I want it show the vertical scrollbar always > > so the user can know there are more options below. > > I ha tried the scrollbarAlwaysDrawVerticalTrack="true" but it doesn't > > work, any idea/suggestion? > > > Thanks in advance. > > > -- > > 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 > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them -- 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] scrollbarAlwaysDrawVerticalTrack doesn't work with ListView
Hi, I have a ListView and I want it show the vertical scrollbar always so the user can know there are more options below. I ha tried the scrollbarAlwaysDrawVerticalTrack="true" but it doesn't work, any idea/suggestion? Thanks in advance. -- 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: What is exactly the X and Y coordinates in method "canvas.rotate"
That link was very useful to understand how the pivot point works, now I understand it perfectly. I was using 48, 48 as pivot and I didn't realized that was the middle X and middle of my drawable (it sizes 96x96) so that's because it rotate properly. Thank you very much. On Sep 18, 1:51 pm, Kostya Vasilyev wrote: > The coordinates are the rotation's center point (called the pivot > point in the docs). > > See here for an interactive demo: > > http://www.nbilyk.com/pivot-rotate-example > > If you set these coordinates to the center of the canvas, you'll get the > most intuitive result. But other rotations are possible as shown in the > link above. > > -- Kostya > > 18.09.2010 13:37, jlopeznava...@gmail.com пишет: > > > > > > > Can anybody explain me what is exactly that coordinates? I have search > > for information but can't find properly info. > > I have some drawables objects wich I need to rotate, I have realized I > > need to add a constant value to that coordinates, if not they rotate > > wrong. > > > I use this way: > > > === > > === > > canvas.save(); > > canvas.rotate(90 * mRotatationType, CTE_ROTATING_X_POINT + coordX, > > CTE_ROTATING_Y_POINT + coordY); > > canvas.restore; > > === > > === > > > Where: > > -mRotatationType: is set to 0, 1, 2, or 3 in order to get a 0, 90, > > 180, 270º rotation. > > -coordX and coordY are the top/left points of my drawable object. > > -CTE_ROTATING_X_POINT and CTE_ROTATING_Y_POINT are set to "48" (if not > > the drawables move in a different place after rotate). This is the > > mistery for me. > > -- > 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 at http://groups.google.com/group/android-developers?hl=en
[android-developers] Best method to save a array in Bundle?
I have 2 dimensions array like this: public myArrayType[][] mObjArray; I want to save it in the onSaveInstanceState method, since my array contains lot of elements I dont want to save element by element but the whole array object, what is the best way? I tried this but exception is thrown: - public Bundle saveState(Bundle map) { if (map != null) { map.putSerializable("objLevel", (Serializable) mCurrentLevelMatrix); } return map; } --- I have seen a putParcelableArrayList method but dunno how it works exactly. -- 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] What is exactly the X and Y coordinates in method "canvas.rotate"
Can anybody explain me what is exactly that coordinates? I have search for information but can't find properly info. I have some drawables objects wich I need to rotate, I have realized I need to add a constant value to that coordinates, if not they rotate wrong. I use this way: == canvas.save(); canvas.rotate(90 * mRotatationType, CTE_ROTATING_X_POINT + coordX, CTE_ROTATING_Y_POINT + coordY); canvas.restore; == Where: -mRotatationType: is set to 0, 1, 2, or 3 in order to get a 0, 90, 180, 270º rotation. -coordX and coordY are the top/left points of my drawable object. -CTE_ROTATING_X_POINT and CTE_ROTATING_Y_POINT are set to "48" (if not the drawables move in a different place after rotate). This is the mistery for me. -- 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 getting wrong sizes with drawables objects.
You are right, what a noob error :( Thank you man. On Sep 17, 11:10 pm, Romain Guy wrote: > You are probably using drawable/ or drawable-mdpi/ assets on an hdpi > device and your assets get scaled automatically. > > On Fri, Sep 17, 2010 at 10:00 AM, jlopeznava...@gmail.com > > > > > > wrote: > > Hi, I am using some drawable objects, when I instance them and paint > > in my canvas they doesn't get the original PNG image file size, > > instead they get a bigger size, so they does't paint in my canvas as I > > expected since I wanted them in their original sizes, why this > > happens??? > > > (original file is 96x96 pixels) > > > --- > > --- > > mSprite = mRes.getDrawable(R.drawable.my_sprite); > > > mSpriteWidth = mSprite.getIntrinsicWidth(); // It returns 114, not 96 > > mSpriteHeight = mSprite.getIntrinsicHeight(); // It returns 114, not > > 96 > > > mSprite.setBounds(coordX, coordY, coordX + mSpriteWidth, coordY + > > mSpriteHeight); > > mSprite_PipeRect.draw(canvas); //It paints at 114x114 size, it shows > > bigger in the screen then original size > > > --- > > --- > > > Something similar happens with the background but it is fixed in the > > "setSurfaceSize" event this way: > > > public void setSurfaceSize(int width, int height) { > > mBackgroundImage = > > Bitmap.createScaledBitmap(mBackgroundImage, width, height, > > true); > > } > > > In this case height and widht is properly provided in the event > > parameters > > > --- > > --- > > > Why are not loaded in their original size, and how to get original > > size for my drawables??? > > > Thanks in advance. > > > -- > > 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 > > -- > Romain Guy > Android framework engineer > romain...@android.com > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them -- 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 getting wrong sizes with drawables objects.
Hi, I am using some drawable objects, when I instance them and paint in my canvas they doesn't get the original PNG image file size, instead they get a bigger size, so they does't paint in my canvas as I expected since I wanted them in their original sizes, why this happens??? (original file is 96x96 pixels) -- mSprite = mRes.getDrawable(R.drawable.my_sprite); mSpriteWidth = mSprite.getIntrinsicWidth(); // It returns 114, not 96 mSpriteHeight = mSprite.getIntrinsicHeight(); // It returns 114, not 96 mSprite.setBounds(coordX, coordY, coordX + mSpriteWidth, coordY + mSpriteHeight); mSprite_PipeRect.draw(canvas); //It paints at 114x114 size, it shows bigger in the screen then original size -- Something similar happens with the background but it is fixed in the "setSurfaceSize" event this way: public void setSurfaceSize(int width, int height) { mBackgroundImage = Bitmap.createScaledBitmap(mBackgroundImage, width, height, true); } In this case height and widht is properly provided in the event parameters -- Why are not loaded in their original size, and how to get original size for my drawables??? Thanks in advance. -- 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