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. Basic App -- not working

I went through the NotePad tutorials and got the minimum hang of it.
Unfortunately, when I tried creating my own application, I failed.
Here's my main class file:

package com.tastekid.TasteKid;

import android.app.Activity;
import android.os.Bundle;

public class TasteKid extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

Here's main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
        <EditText
                android:id="@+id/search_input"
        />
</LinearLayout>

When I try to start the app on the emulator I get an "The application
TasteKid (process com.tastekid.TasteKid) has stopped unexpectedly.
Please try again." with a "Force close" button. I have absolutely no
idea what I am doing wrong :-(

--~--~---------~--~----~------------~-------~--~----~

2. AudioRecord

Hi,
I'd like to use the AudioRecord API, but it's not clear to me how it
should be called.  I put a call to the logger in the listener
callback, but don't see an message logged anywhere.  Any pointers?

Thanks,
Ben


import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.util.Log;

public class AudioListener {

  public static final int DEFAULT_SAMPLE_RATE = 8000;
  private static final int DEFAULT_BUFFER_SIZE = 4096;
  private static final int CALLBACK_PERIOD = 4000;  // 500 msec
(sample rate / callback period)
  private final AudioRecord recorder;

  public AudioListener() {
    this(DEFAULT_SAMPLE_RATE);
  }

  private AudioListener(int sampleRate) {
    recorder = new AudioRecord(MediaRecorder.AudioSource.DEFAULT,
        sampleRate, AudioFormat.CHANNEL_CONFIGURATION_DEFAULT,
        AudioFormat.ENCODING_DEFAULT, DEFAULT_BUFFER_SIZE);
  }

  public void start() {
    recorder.setPositionNotificationPeriod(CALLBACK_PERIOD);
    recorder.setRecordPositionUpdateListener(new
AudioRecord.OnRecordPositionUpdateListener() {
      @Override
      public void onMarkerReached(AudioRecord recorder) {
        Log.e(this.getClass().getSimpleName(), "onMarkerReached
Called");
      }

      @Override
      public void onPeriodicNotification(AudioRecord recorder) {
        Log.e(this.getClass().getSimpleName(), "onPeriodicNotification
Called");
      }
    });

    recorder.startRecording();
  }

}

--~--~---------~--~----~------------~-------~--~----~

3. Lesson from ADC2 - Polish Your App!

4. OpenGL SegFaults after GLSurfaceView onPause/onResume

5. KXML and Android

6. MediaRecorder does'n work with incoming calls stream

7. MediaRecorder does'n work with incoming calls stream