AddMusic example Ipod library access [closed] - objective-c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I want to use the addmusic example that apple have created for the IPod library access and be able to play the music in MY application; I however dont know which files to copy and how to combine the two... can someone please tell me what to do?
I already have created a button in MY application which will then upon click do the same thing that the button in the AddMusic example does to open up the Mediapicker thing.
Any help will be greatly appreciated.

You don't need to copy any specific files from the example, just some of the functions.
To pick the music you use MPMediaPickerController , look at AddMusicOrShowMusic in MainViewController.m to see how to instantiate that and what delegate methods you need to implement.
The important class you need to use to play the music is MPMusicPlayerController. In MainViewController.m you'll see the methods you need to implement and how to use it, see - (IBAction) playOrPauseMusic: (id)sender { for example.
Essentially you'll take the media items returned by MPMediaPickerController and call setQueueWithItemCollection on the MPMediaPickerController to queue up the music. After that it's really just a case of calling play/pause/etc and updating your interface.
The code you need is all in there, you just need to pull out the right bits.

Related

Can I start a call from a hybrid application by clicking on one button using MobileFirst? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
i want to develop a hybrid application which makes a phone call to a static number automatically when clicking on a button using mobilefirst.can you help me?
It's not specific to IBM MobileFirst. A bit of googling would've given you the answer you needed...
Here are a couple of options to open the dialer with a number:
Directly in the HTML (you can style the a to look like a 'button'): call this number
Using JavaScript code to be called in a function: document.location.href = "tel:+375292771265";
Edit:
It seems that you want to auto-dial.
iOS: In iOS this is not allowed in webpages. Worklight apps are essentially web code and thus considered a "webpage" by the OS and will thus first display an alert confirming if the end-user truly wants to call this number or not. In a native app the dialer will auto-dial. This can be read in the iOS documentation: https://developer.apple.com/library/ios/featuredarticles/iPhoneURLScheme_Reference/PhoneLinks/PhoneLinks.html
Android: not allowed by the OS. You may be able to achieve this using a Cordova plug-in: see how to create Cordova plug-ins in MobileFirst Platform Foundation and a possible functionality implementation.

Building a document based application in Xcode 5 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am new to Xcode 5 and I want to create a document based application that loads my file (a basic text file with the extension .rt) into an NSTextView and allows me to save the contents of the NSTextView to the file
Is this the right way to set it up?:
Will I need to use the functions
-(NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError;
-(BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError;
3.Are there any basic tutorials that show how to do this in Xcode 5? Most of the tutorials that I have found show how to do this in 10.4<
That looks fine so far as it goes.
You'll need to provide some way to store and retrieve the document's data. -readFromData:of type:error: is one way, but there are also methods that read from a file wrapper or an URL that yo can implement instead.
I don't know of any off the top of my head, and questions seeking resources are generally off topic here. However, Apple's documentation is pretty solid. If you have trouble understanding how to do something, why not ask a question about how to solve that problem rather than searching for step-by-step instructions? Also, Xcode is just a development environment -- most of the information in tutorials written for Xcode 4 should be pretty easy to map to Xcode 5 if you understand what they're trying to accomplish rather than just following the pictures.

Expiring Data In Table View (Even After An App Is Closed And Restarted) (iOS) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I need help being pointed in the right direction (to the right documentation or tutorial) since I don't know exactly what this programming would be filed under.
Basically, I saw an app that had a section of 'Deals' on food and drinks at stores. You had to use the app to redeem the deal, but you could only use the deal once. It seemed that the table view of deals was being populated by a PList from a server (because it is constantly updated) BUT when you choose a deal and use it, it disappears from the table view (because you claimed it).
Now I was thinking it could be coding using an if else statement declaring integer values (and if they weren't equal to the integer, then the deal wouldn't display) but that can't be the case because if I close out the app and reopen it, the deal still isn't in the list. Am I right in assuming that somehow the PList or database is being updated by the user interaction? Are databases for each user being created when someone downloads the app (or starts it)?
I'm kinda in the dark about it and trying to figure out how they pull this off. I'm not sure if I'm way off base and there is some sort programming that I'm possibly not even aware of. Any thoughts? Thanks!
You should investigate NSFetchedResultsController - it allows to perform a lot of pretty things with your data + database.
Check this tutorial.
Also, take a look at the Apple documentation.
Core data basics strongly required.

Direct screen pixel/framebuffer access [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I'd like to try and create a program playing a game. I.e. "a bot".
I want to be able to directly access the pixels on the screen. I.e. have my program "see" a game and then "make a move"(or at least draw a picture of what move it would make).
Both Windows and Linux advice is appreciated, though my guess is that it should be easier to do on Linux.
I'm guessing this could be done with some X/Gnome call?
I'm not afraid of C, even complex samples are welcome.
SDL is a cross-platform library that allows you to directly access framebuffer pixels. You can learn about accessing the pixels on screen through the pixel access example on the documentation wiki.
Generally speaking, bots don't see the game graphics but see the underlying data structure instead, unless you are trying to do something related to computer vision.

custom container [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
In SAP,
can we have a push button on custom container in ALV. Is it possible or is there any other possibilities for that.? Pls help me...
Thanks in advance
Well, I would rather use custom containers for things like tableviews. If you are working with the standard Dynpros you can just add a button in the dynpro designer and implement the behaviour you would like. To give a more detailled answer, I would need to know what you are planning to do. Of course you can also create a ALV grid and modify the buttons which are displayed there. Maybe you elaborate a little bit more what you're planning to do and then I can give you a recommendation.
Yes, this is possible - check out class CL_GUI_TOOLBAR and the associated documentation (like http://help.sap.com/printdocu/core/Print46c/de/data/pdf/BCCITOOLBAR/BCCITOOLBAR.pdf) and sample programs. AFAIR there's a demo program that lets you assemble a toolbar dynamically, I just don't remember the name. You'll usually want to insert some kind of splitter first, then add the toolbar to one side of the container so that you can place other elements like trees or tables next to it.