icesimon's Blog

  • About Me
  • Archive
  • feeds

Posts match “ BlackBerry ” tag:

about 7 years ago

Use QML to play music in Cascades

MediaPlayer

Steps:

  1. Add bb.multimedia 1.0 in qml file.

  2. Create a MediaPlayer Object.

  3. Set path of file for MediaPlayer. (Need permission for access_shared)

  4. Call the play() function of MediaPlayer. (Need permission Run when background if you want to play music in background).

BlackBerry 10 can support file format below:
AAC: audio/aac, audio/x-aac
AMR: audio/amr, audio/x-amr
FLAC: audio/flac
M4A: audio/m4a, audio/mp4
MIDI: audio/midi, audio/mid, audio/x-midi, audio/x-mid
MKA: audio/x-matroska
MP3: audio/mp3
OGG: audio/ogg
QCP: audio/x-gsm
SPMID: audio/spmid
WAV: audio/wav, audio/x-wav
WMA: audio/x-ms-wma

  • BlackBerry
  • BB10
  • Cascades
  • QML
  • MediaPlayer
  • music
  • January 31, 2016 11:13
  • Permalink
  • Comments
 
about 7 years ago

Clipboard usage in Cascades

In C++, need to import LIBS += -lbbsystem

QString text;
bb::system::Clipboard clipboard;
clipboard.clear();
QByteArray byte;
byte = text.toLocal8Bit();
clipboard.insert(“text/plain”,byte);

Remember, the Clipboard need insert QByteArray type.
We can define the String as QByteArray in order to use the Clipboard.
If you need to use some special characters, don't forget to use this line

byte = text.toLocal8Bit();

Here is the official API reference :)
http://developer.blackberry.com/cascades/reference/bb__system__clipboard.html

  • BlackBerry
  • BB10
  • Cascades
  • Clipboard
  • Tips
  • February 01, 2016 13:55
  • Permalink
  • Comments
 
  • Previous
  • 1
  • 2

Copyright © 2013 icesimon . Powered by Logdown.
Based on work at subtlepatterns.com.