Standard Android Music Player

by Nick Mitin » Tue, 09 Feb 2010 01:41:56 GMT


Sponsored Links
 Is there any way to pass a file or a playlist to a standard Android
Music Player? I guess almost all applications, for instance, i Music
do it.

--



Standard Android Music Player

by Sean Hodges » Tue, 09 Feb 2010 16:52:59 GMT


 Accroding to a comment in the OpenIntents site
( http://www.openintents.org/en/node/112 ), this should work:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
Uri data = Uri.parse("file:///sdcard/song.mp3");
String type = "audio/mp3";
intent.setDataAndType(data, type);
startActivity(intent);

Haven't tested it though.




>


Sponsored Links


Other Threads

1. How to porting android on the "SuperH"cpu

Dear all,
I used a platform  "migo-R" which cpu is SH7722.
I download a android kernel source "linux-2.6.25-
android-1.0_r1.tar.gz" from "http://code.google.com/p/android/
downloads/list".
The toolchain is "gnush4-nofpu_linux_v0701-1.tar.gz".
http://www.superh-linux.org/platforms/index.html#sh7722migor


(step 1). I set up "NFS" from migo-R to the Host PC.

(step 2). Generate the default .config for the kernel using the
migor_default config ,the config file found /kernel/arch/sh/configs/
migot_defconfig (ARCH is case sensitive)  --> make migor_defconfig
ARCH=sh

(step 3).When I complier the kenel,it will be something wrong. The
binder source code seems to be lacked some file,so I modify the binder
to module<M> in the kernel. Then it continues to complier to generate
uImage.

(step 4). I use the U-boot to start the uImage.

U-Boot 1.3.2 (Feb 20 2009 - 10:09:17)
CPU: SH4
BOARD: Renesas MigoR
DRAM:  64MB
FLASH: 64MB
In:    serial
Out:   serial
Err:   serial
Net:   Hit any key to stop autoboot:  0
=> tftp 8c400000 uImage_myandroid_nfs0317_v2

Warning: MAC addresses don't match:
        HW MAC address:  FF:FF:FF:FF:FF:FF
        "ethaddr" value: 12:34:56:78:9A:BC
Using MAC Address 12:34:56:78:9A:BC
TFTP from server 192.168.0.3; our IP address is 192.168.0.15
Filename 'uImage_myandroid_nfs0317_v2'.
Load address: 0x8c400000
Loading:
#################################################################
         ###########################################
done
Bytes transferred = 1584452 (182d44 hex)
=> bootm 8c400000
## Booting image at 8c400000 ...
   Image Name:   Linux-2.6.27-00114-g462bfbf-dirt
   Image Type:   SuperH Linux Kernel Image (gzip compressed)
   Data Size:    1584388 Bytes =  1.5 MB
   Load Address: 8c001000
   Entry Point:  8c002000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
Linux version 2.6.27-00114-g462bfbf-dirty
(r...@mirl194052.mirl.itri.org.tw) (gcc version 4.2-SH4-LINUX_v0701)
#3 Tue Mar 17 11:38:48 CST 2009
Boot params:
... MOUNT_ROOT_RDONLY - 00000000
... RAMDISK_FLAGS           - 00000000
... ORIG_ROOT_DEV           - 00000000
... LOADER_TYPE               - 00000000
... INITRD_START                - 00000000
... INITRD_SIZE                   - 00000000
Booting machvec: Migo-R
Node 0: start_pfn = 0xc000, low = 0x10000
Node 1: start_pfn = 0x55f0, low = 0x5610
Zone PFN ranges:
  Normal   0x000055f0 -> 0x00010000
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    1: 0x000055f0 -> 0x00005610
    0: 0x0000c000 -> 0x00010000
Built 2 zonelists in Node order, mobility grouping on.  Total pages:
16287
Policy zone: Normal
Kernel command line: console=ttySC0 root=/dev/nfs nfsroot=/home/MigoR-
Linux-BSP/MigoR_JPN/packages/rootfs/rootfs ip=192.168.0.15:192.168.0.3
init=/init
PID hash table entries: 256 (order: 8, 1024 bytes)
Using tmu for system timer
Using 8.333 MHz high precision timer.
Console: colour dummy device 80x25
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 61048k/65664k available (2305k kernel code, 570k data, 140k
init)
PVR=10300800 CVR=01440111 PRR=00000a10
I-cache : n_ways=4 n_sets=256 way_incr=8192
I-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
D-cache : n_ways=4 n_sets=256 way_incr=8192
D-cache : entry_mask=0x00001fe0 alias_mask=0x00001000 n_aliases=2
Calibrating delay loop... 132.09 BogoMIPS (lpj=264192)
Mount-cache hash table entries: 512
CPU: SH7722
net_namespace: 288 bytes
NET: Registered protocol family 16
SCSI subsystem initialized
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
JFFS2 version 2.2. (NAND) ?? 2001-2006 Red Hat, Inc.
yaffs Mar 17 2009 11:37:52 Installing.
msgmni has been set to 119
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
SuperH SCI(F) driver initialized
sh-sci: ttySC0 at MMIO 0xffe00000 (irq = 80) is a scif
console [ttySC0] enabled
sh-sci: ttySC1 at MMIO 0xffe10000 (irq = 81) is a scif
sh-sci: ttySC2 at MMIO 0xffe20000 (irq = 82) is a scif
brd: module loaded
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
smc91x.c: v1.1, sep 22 2004 by Nicolas Pitre <n...@cam.org>
eth0: SMC91C11xFD (rev 2) at b0000300 IRQ 32 [nowait]
eth0: Ethernet addr: 12:34:56:78:9a:bc
Driver 'sd' needs updating - please use bus_type methods
physmap platform flash device: 04000000 at 00000000
physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank
 Amd/Fujitsu Extended Query Table at 0x0040
physmap-flash.0: CFI does not contain boot bank location. Assuming
top.
number of CFI chips: 1
cfi_cmdset_0002: Disabling erase-suspend-program due to code
brokenness.
RedBoot partition parsing not available
Using physmap partition information
Creating 3 MTD partitions on "physmap-flash.0":
0x00000000-0x00100000 : "uboot"
0x00100000-0x01000000 : "rootfs"
0x01000000-0x04000000 : "other"
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd3 (Samsung NAND 1GiB
3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 3924 at 0x1ea80000
Bad eraseblock 3925 at 0x1eaa0000
Bad eraseblock 3949 at 0x1eda0000
Creating 2 MTD partitions on "gen_nand.0":
0x00000000-0x20000000 : "nanddata1"
0x20000000-0x40000000 : "nanddata2"
m66592_udc m66592_udc: version 18 Oct 2007
g_serial gadget: Gadget Serial v2.4
g_serial gadget: g_serial ready
input: sh_keysc as /class/input/input0
rtc-rs5c372 0-0032: can't read registers
rtc-rs5c372: probe of 0-0032 failed with error -5
oprofile: using timer interrupt.
TCP cubic registered
NET: Registered protocol family 17
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
eth0: link down
IP-Config: Guessing netmask 255.255.255.0
IP-Config: Complete:
     device=eth0, addr=192.168.0.15, mask=255.255.255.0,
gw=255.255.255.255,
     host=192.168.0.15, domain=, nis-domain=(none),
     bootserver=192.168.0.3, rootserver=192.168.0.3, rootpath=
Looking up port of RPC 100003/2 on 192.168.0.3
eth0: link up, 100Mbps, full-duplex, lpa 0x41E1
Looking up port of RPC 100005/1 on 192.168.0.3
VFS: Mounted root (nfs filesystem).
Freeing unused kernel memory: 140k freed
Failed to execute /init.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option
to kernel.

(step 5).The download source is :www.androidin.com/bbs/pub/
armv4.tar.gz
 I check to file system.
[r...@mirl194052 rootfs]# file init
init: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically
linked, stripped

The questions are (1)Do I have do something error ?,(2) Is the init
for ARM cpu, not for SuperH cpu (3) How to generate the init file for
superH? (4) Is Android supported the SuperH(sh7722)?
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Update view from thread

Hello

I want to create a timer, which will show time left for the end of
timer.

There are several attempts, but every time I have different errors.
Please, help me.

Here is one of my attempts:

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.widget.TextView;
import android.widget.Toast;

public class MyThread extends Activity implements Runnable {

        TextView textOut;

        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);

                textOut = (TextView) findViewById(R.id.textOut);

                new Thread(this).start();
        }

        private void updateTimer(int timerState) {
                textOut.setText(new StringBuilder().append(timerState));
        }

                public void run() {
                        for (int i = 0; i < 5; i++) {
                                updateTimer(i);
                                try {
                                        Thread.sleep(2000);
                                } catch (InterruptedException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }

                                // textOut.setText(new 
StringBuilder().append(i).append("ok"));
                        }
                }
}

First time the text is updated to 0, next time there is an error in
this line:
textOut.setText(new StringBuilder().append(timerState));

Do you have any ideas or may be can you suggest another method of
solving the problem?

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

3. how to get gps status

4. orientation change crashes when ids are not unique

5. how to read specific part in a string

6. Notepadv1Solution Problem

7. Failed to start system_server