need reference page for how to write a png from res/drawable to background as wallpaper

by Spooky » Fri, 20 May 2011 09:53:23 GMT


Sponsored Links
 I've been trying to find a reference and/or example page
explaining how to write a png image file from res/drawable
to the background as wallpaper for about the last five days
now ... I give up...time to ask for help finding either or
both of the above....  I've seen all kinds of references to
unrelated sties, but I just can't find the right page.

Can someone please point me in the right direction?

Thanks,
   --jim

-- 



Re: need reference page for how to write a png from res/drawable to background as wallpaper

by Saurav » Fri, 20 May 2011 12:26:31 GMT


 You mean wallpaper for phone home screen?




Regards,
Saurav Mukherjee.






-- 


Sponsored Links


Re: need reference page for how to write a png from res/drawable to background as wallpaper

by Spooky » Fri, 20 May 2011 12:54:40 GMT


 


Ok, here's a chance for me to possibly clear up my own confusion.
I've
been under the impressions that A) the home screen is THE screen
that you get when you press the HOME button, and that the rest are
other screens, and B) that ALL of the phone's screens are Home
screens.......

I'm talking about wallpaper that you load on the backgrounds of the
seven screens.

I'm working on a photography app, and I want the user to be able,
if they want to do so, to load any of my photos (which, before the
app is built, are in res/drawable) on their Home screen/screens.

I've been looking every day until my eyes start screaming, and after
that, I've kept looking until my eyes go totally blurry for the rest
of
the day (and beyond, sometimes) for just under a week, and have
gotten lots and lots of unrelated pages, but nothing relevant so far.

Later,
   --jim

-- 



Re: Re: need reference page for how to write a png from res/drawable to background as wallpaper

by Saurav » Fri, 20 May 2011 14:05:32 GMT


 I am guessing this is what u want,

WallpaperManager manager = WallpaperManager.getInstance(this);
try {
manager.setResource(R.drawable.wallpaper);
 } catch (IOException e) {
e.printStackTrace();
}

U need to add SET_WALLPAPER permissions in ur manifest file.

Hope this helps.


Regards,
Saurav Mukherjee.








-- 



Re: need reference page for how to write a png from res/drawable to background as wallpaper

by Spooky » Fri, 20 May 2011 17:39:08 GMT


 



Looks like exactly what I need.  Thanks!   I also have something
far more likely to get better search results (for a reference page),
too---so thanks for that, as well!

Later,
   --jim

-- 



Other Threads

1. textview and selectors

hi,

I have some TextViews that are clickable and focusable and I tried to
set their background with a selector:

<TextView style="@style/tv_style1"/>

<style name="tv_style1">
  <item name="android:layout_width">fill_parent</item>
  <item name="android:layout_height">fill_parent</item>
  <item name="android:clickable">true</item>
  <item name="android:focusable">true</item>
  <item name="android:background">@drawable/tv_bcg_selector</item>
</style>

in file drawable/tv_bcg_selector.xml
<selector xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:state_selected="true" android:color="#0000FF"/>
  <item android:color="#00FF00"/>
</selector>

but whenever I run the application it stops unexpectedly, I tried to
run with the selector empty and it does run, but not with it filled,
maybe I'm missing something about selectors

thanks

-- 

2. mpg123's Assembly Code With the NDK

In my continuing quest to slow down or speed up MP3s without altering
the pitch, I came across mpg123.  I am now at the point where I can
compile and run using the libraries, and I get decoded MP3s.
(Hooray!)  Unfortunately, I'm at about 0.45x real-time on a G1, which
isn't fast enough.  One guy was able to get 20x real-time using libmad
( http://apistudios.com/hosted/marzec/badlogic/wordpress/?p=231 ) but
I'd prefer not to use that since mpg123 is LGPL while libmad is GPL.

I'm led to believe that the main advantage of mpg123 is the amount of
code optimized by using assembly.  In particular, I want to use the -
DOPT_ARM, but doing so gives the error:

out/apps/decoder/android-1.5-arm/objs/decoder/mpg123/src/libmpg123/
synth.o: In function `synth_1to1_arm':
sources/decoder/mpg123/src/libmpg123/synth.c:537: undefined reference
to `synth_1to1_arm_asm'

This is my Android.mk file:
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE    := decoder
LOCAL_ARM_MODE  := arm
LOCAL_SRC_FILES := media_decoder.cpp mpg123/src/libmpg123/libmpg123.c
mpg123/src/libmpg123/frame.c mpg123/src/libmpg123/parse.c mpg123/src/
libmpg123/id3.c mpg123/src/libmpg123/icy.c mpg123/src/libmpg123/
icy2utf8.c mpg123/src/libmpg123/format.c mpg123/src/libmpg123/
readers.c mpg123/src/libmpg123/layer1.c mpg123/src/libmpg123/layer2.c
mpg123/src/libmpg123/layer3.c mpg123/src/libmpg123/optimize.c mpg123/
src/libmpg123/synth.c mpg123/src/libmpg123/equalizer.c mpg123/src/
libmpg123/dct64.c mpg123/src/libmpg123/tabinit.c mpg123/src/libmpg123/
synth_real.c mpg123/src/libmpg123/synth_s32.c mpg123/src/libmpg123/
stringbuf.c mpg123/src/libmpg123/compat.c mpg123/src/libmpg123/
synth_arm.S
LOCAL_CFLAGS    := -DHAVE_CONFIG_H -DFPM_ARM -ffast-math -O3 -DOPT_ARM
-DNO_8BIT -DNO_NTOM -nostdlib -enable-int-quality -mandroid

include $(BUILD_SHARED_LIBRARY)

It compiles and runs fine if I change -DOPT_ARM to -DOPT_GENERIC and
remove mpg123/src/libmpg123/synth_arm.S

How can I decode MP3s at least as fast as real time without
immediately playing them?  Really I need to be significantly faster
than that, depending on how much I can optimize my slowdown code.

-- 

3. View the Task's activity stack

4. HTC hero home screen

5. How to configure a new test package in CTS

6. set system setting 鈥渦se only 2g networks鈥?programatically

7. MediaPlayer playback is slow