Hi all,

In answer to Jim's question three if by orientation you mean the user should
be able to rotate the image on its side (lanscape) or keep it standing
(portrait) then iI suggest you could look at
http://www.anddev.org/resize_and_rotate_image_-_example-t621.html This link
also has the commented code for both resize and rotate.

Sorry but I can't help you with the other two questions.

As for the wiki I have started. I would like it to be self contained and not
link excessively to outside sources. That is I would like an article to
exist on every topic related to Android. What I had in mind when I started
it was to have an article on each Android device, each part of the SDK with
example code, building android and rooting. This was what I had in mind but
if there is any topic I have left out feel free to add it.

So I ask once again. Can all or atleast some of you help me make this wiki
into a complete resource for Android. I don't expect it to happen overnight
but as more and more people do it it will improve. I am not saying write the
entire thing by yourself. Even one article from a person will suffice.

Thanks

On Wed, Jun 1, 2011 at 12:30 PM, Raghav Sood <[email protected]> wrote:

> Hi Jim
>
> newbies are very welcome here. as for your email problem you may need
> to write to the moderator. i can't help you with q1 and 2 but i will
> send you the links for q3 as soon a i get home in about an hour. If
> you want to help with the wiki just go to
> http://wiki.androidappcheck.com sign up and start posting.
>
> oh and the majority of the group is helpful.
>
> Thanks
> On Wednesday, June 1, 2011, Jim Graham <[email protected]> wrote:
> > On Wed, Jun 01, 2011 at 12:03:46AM +0530, Raghav Sood wrote:
> >> Anyone who can help?
> >
> > I'm posting this to the list via e-mail ... but I'm CC'ing you, because
> > I'm 99% certain that whoever moderates this group has no intention of
> > fixing whatever is keeping me from posting via e-mail.....  I AM a
> > newbie, after all...not exactly welcome here (at least, to some people;
> > others have been helpful---I have yet to figure out who is the majority
> > and who is the minority in that department).
> >
> > Still, I have collected a number of links to both Android and, today,
> > Java references/tutorials/examples.  I can't promise that they're all
> > perfectly organized by where they should be, but the titles should
> > help.  If you'd like me to, I'll extract them from Mozilla Seamonkey
> > on the Windoze side, bring them over here, and e-mail them to you
> > directly.
> >
> > Perhaps a section specifically for newbies?  :-)   I can certainly help
> > with that, at least, when I'm able to find something useful, that is.
> >
> > I would like to ask a favor, though...something I've asked about, and
> > gotten zero responses on.  See below the next paragraph for details.
> >
> > Sounds like a very worthwhile effort.  I can certainly vouch for all you
> > said about info being incomplete (a cryptic manual without examples is
> > just plain cryptic to someone just learning a new language, i.e., Java
> > and Android-specific Java), spread far and wide, non-existent, etc.
> >
> > ---------------------------  CUT HERE  ---------------------------
> >
> > Two things.  First, I've got an Integer[] array of R.drawable.foo
> > pointers to filenames in res/drawable, and an integer index to said
> > array.  It is defined in a class within my main activity class.  I
> > also need it in another section of the code for the context menu.
> > The blocks of code look like this (bits in-between deleted to keep
> > this brief):
> >
> > public class SNGallery extends Activity {
> > [....]
> >         Gallery g = (Gallery) findViewById(R.id.gallery);
> > [....]
> >                 g.setOnItemClickListener(new OnItemClickListener() {
> >             String[] textValues =
> getResources().getStringArray(R.array.Image_Titles);
> >             public void onItemClick(AdapterView parent, View v, int
> position, long id) {
> >             final String image_title = textValues[position];
> >             Toast.makeText(SNGallery.this, image_title,
> Toast.LENGTH_LONG).show();
> >
> > [....]
> >
> > # NOTE:  I have the position within the array above ("int position").  I
> > # don't have the array itself, and thus far, have had to re-enter it.
> > # This cannot possibly be the right way.
> >
> >         // also show context menu for longpress on image
> >         registerForContextMenu(g);
> >         }
> >          @Override
> >             public void onCreateContextMenu(ContextMenu menu, View v,
> ContextMenuInfo menuInfo) {
> >                 menu.add(R.string.wallpaper);
> >                 menu.add(R.string.info);
> >             }
> >
> >             @Override
> >             public boolean onContextItemSelected(MenuItem item) {
> >                 AdapterContextMenuInfo info = (AdapterContextMenuInfo)
> item.getMenuInfo();
> >                 WallpaperManager manager =
> WallpaperManager.getInstance(this);
> >
> >
> >             Integer[] mImageIds = {
> >                 R.drawable.srsound7500,
> R.drawable.boatonsound2ndplace,
> > [....]
> >                 R.drawable.smokymountains6,
> R.drawable.koala
> >             };
> >                   try {
> >                   manager.setResource(mImageIds[info.position]);
> >                    } catch (IOException e) {
> >                   e.printStackTrace();
> >                 }
> >
> >                 return true;
> >             }
> > [....]
> >
> >         public class ImageAdapter extends BaseAdapter {
> >             int mGalleryItemBackground;
> >             private Context mContext;
> >
> >             public Integer[] mImageIds = {
> >                 R.drawable.srsound7500,
> R.drawable.boatonsound2ndplace,
> > [....]
> >                 R.drawable.smokymountains6,
> R.drawable.koala
> >             };
> > [....]
> >             i.setImageResource(mImageIds[position]);
> >                 i.setLayoutParams(new Gallery.LayoutParams(-1, -1));
> >             i.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
> >                 i.setBackgroundResource(mGalleryItemBackground);
> >
> >
> >
> > ---------------------------  CUT HERE  ---------------------------
> >
> > Ok, this code covers both questions.
> >
> > Question 1:  How, without re-writing its definition, can I reference
> >              mImageIds from the context menu by accessing its variable
> >              (mImageIds) in the ImageAdapter class?
> >
> >
> > Question 2:  Bonus question....  I've already done the description text
> >              as an array of strings in XML.  Is there a way to do that
> >              with the R.drawable.foo references, too, so that it fits
> >              into the above code?
> >
> > Question 3:  Can you point me to some *commented* example code that shows
> >              how to A) resize the image, and B) let the user pick an
> >              orientation to keep it in (landscape, portrait, or match
> >              the phone's orientation) before setting it to wallpaper?
> >
> > I'll help with the links, if you like, regardless of whether or not you
> > help me with these, but I would definitely appreciate some help.  :-)
> >
> > Thanks,
> >    --jim
> >
> > --
> > 73 DE N5IAL (/4)        MiSTie #49997  < Running FreeBSD 7.0 >
> > [email protected] ICBM/Hurricane: 30.44406N 86.59909W
> >
> >       "'Wrong' is one of those concepts that depends on witnesses."
> >      --Catbert:  Evil Director of Human Resources (Dilbert, 05Nov09)
> >
> >
>
> --
> Raghav Sood
> http://www.raghavsood.com/
> http://www.androidappcheck.com/
> http://www.telstop.tel/
>



-- 
Raghav Sood
http://www.raghavsood.com/
http://www.androidappcheck.com/
http://www.telstop.tel/

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

Reply via email to