[JAM 1.2] Design & Multitasking (Andrew Solovey)

805 views
654 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
805
On SlideShare
0
From Embeds
0
Number of Embeds
25
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • [JAM 1.2] Design & Multitasking (Andrew Solovey)

    1. 1. Часть первая: Заявка на дизайн. материал по сайту artlebedev.ru Андрей Соловей
    2. 2. Джон
    3. 3. Заказчик
    4. 4. Заказчик Дизайнер
    5. 5. Заявка на дизайн
    6. 6. Шаг 1: Возникновение проблемы.
    7. 7. Шаг 2: Осознание проблемы обычными людьми.
    8. 8. Шаг 3: Попытка решить проблему подручнымисредствами, до прихода дизайнера.
    9. 9. Шаг 4: Собственно, дизайнерское решение.
    10. 10. ПрогрессШаг 1: Возникновение проблемы.Шаг 2: Осознание проблемы обычными людьми.Шаг 3: Попытка решить проблему подручными средствами, до прихода дизайнера.Шаг 4: Собственно, дизайнерское решение.
    11. 11. Часть вторая: Многозадачность в iOS.
    12. 12. • AirPlay
    13. 13. • AirPlay• AirPrint
    14. 14. • AirPlay• AirPrint• HTTP Live Streaming Statistics
    15. 15. • AirPlay• AirPrint• HTTP Live Streaming Statistics• iAd
    16. 16. • AirPlay• AirPrint• HTTP Live Streaming Statistics• iAd• Game Center
    17. 17. • AirPlay• AirPrint• HTTP Live Streaming Statistics• iAd• Game Center• Multitasking
    18. 18. #import <sys/sysctl.h>void printProcessInfo(){ int mib[5]; struct kinfo_proc *procs = NULL, *newprocs; int i, st, nprocs; size_t miblen, size; mib[0] = CTL_KERN; // Set up sysctl MIB mib[1] = KERN_PROC; mib[2] = KERN_PROC_ALL; mib[3] = 0; miblen = 4; st = sysctl(mib, miblen, NULL, &size, NULL, 0); // Get initial sizing do // Repeat until we get them all … { size += size / 10; // Room to grow newprocs = (struct kinfo_proc*)realloc(procs, size); if (!newprocs) { if (procs) free(procs); NSLog(@"Error: realloc failed."); return; } procs = newprocs; st = sysctl(mib, miblen, procs, &size, NULL, 0); }while (st == -1 && errno == ENOMEM); if (st != 0) { NSLog(@"Error: sysctl(KERN_PROC) failed."); return; } assert(size % sizeof(struct kinfo_proc) == 0); // Do we match the kernel? nprocs = size / sizeof(struct kinfo_proc); if (!nprocs) { NSLog(@"Error: printProcessInfo."); return; } NSLog(@" PIDtNamen"); NSLog(@"-----t--------------n"); for (i = nprocs-1; i >=0; i--) { NSLog(@"%5dt%sn",(int)procs[i].kp_proc.p_pid, procs[i].kp_proc.p_comm); } free(procs);}
    19. 19. Multitasking: Fast app switching
    20. 20. Multitasking: Fast app switching Push notifications
    21. 21. Multitasking: Fast app switching Push notifications Local notifications
    22. 22. Multitasking: Fast app switching Push notifications Local notifications Background audio
    23. 23. Multitasking: Fast app switching Push notifications Local notifications Background audio Voice over IP
    24. 24. Multitasking: Fast app switching Push notifications Local notifications Background audio Voice over IP Background location
    25. 25. Multitasking: Fast app switching Push notifications Local notifications Background audio Voice over IP Background location Task finishing
    26. 26. Multitasking: Fast app switching Push notifications Local notifications Background audio Voice over IP Background location Task finishing
    27. 27. Fast app switching
    28. 28. Push notifications
    29. 29. Key
    30. 30. !
    31. 31. K ey!
    32. 32. K ey!
    33. 33. !
    34. 34. Local notifications
    35. 35. UILocalNotification
*scheduledAlert
=
[[[UILocalNotification
alloc]
init]
autorelease];scheduledAlert.applicationIconBadgeNumber=10;scheduledAlert.fireDate
=
[NSDate
dateWithTimeIntervalSinceNow:10];scheduledAlert.timeZone
=
[NSTimeZone
defaultTimeZone];scheduledAlert.alertBody
=
@"Ваш
айПад
Самоуничтожится
через
5
секунд!";[[UIApplication
sharedApplication]
scheduleLocalNotification:scheduledAlert];
    36. 36. UILocalNotification
*scheduledAlert
=
[[[UILocalNotification
alloc]
init]
autorelease];scheduledAlert.applicationIconBadgeNumber=10;scheduledAlert.fireDate
=
[NSDate
dateWithTimeIntervalSinceNow:10];scheduledAlert.timeZone
=
[NSTimeZone
defaultTimeZone];scheduledAlert.alertBody
=
@"Ваш
айПад
Самоуничтожится
через
5
секунд!";[[UIApplication
sharedApplication]
scheduleLocalNotification:scheduledAlert];
    37. 37. Multitasking: Fast app switching Push notifications Local notifications Background audio Voice over IP Background location Task finishing
    38. 38. Background audio Voice over IP Background location Info.plist
    39. 39. Background audio:
    40. 40. Background audio: NSData
*
data
=
[self
loadDataFile:@"/We
will
rok
you.mp3"]; AVAudioPlayer
*
player
=
[[AVAudioPlayer
alloc]
initWithData:data
error:nil
]; [player
play]; AVAudioSession
*session
=
[AVAudioSession
sharedInstance]; [session
setCategory:AVAudioSessionCategoryPlayback
error:nil]; [session
setActive:YES
error:nil];
    41. 41. Background audio: NSData
*
data
=
[self
loadDataFile:@"/We
will
rok
you.mp3"]; AVAudioPlayer
*
player
=
[[AVAudioPlayer
alloc]
initWithData:data
error:nil
]; [player
play]; AVAudioSession
*session
=
[AVAudioSession
sharedInstance]; [session
setCategory:AVAudioSessionCategoryPlayback
error:nil]; [session
setActive:YES
error:nil];
    42. 42. Background audio: NSData
*
data
=
[self
loadDataFile:@"/We
will
rok
you.mp3"]; AVAudioPlayer
*
player
=
[[AVAudioPlayer
alloc]
initWithData:data
error:nil
]; [player
play]; AVAudioSession
*session
=
[AVAudioSession
sharedInstance]; [session
setCategory:AVAudioSessionCategoryPlayback
error:nil]; [session
setActive:YES
error:nil];Background location:
    43. 43. Background audio: NSData
*
data
=
[self
loadDataFile:@"/We
will
rok
you.mp3"]; AVAudioPlayer
*
player
=
[[AVAudioPlayer
alloc]
initWithData:data
error:nil
]; [player
play]; AVAudioSession
*session
=
[AVAudioSession
sharedInstance]; [session
setCategory:AVAudioSessionCategoryPlayback
error:nil]; [session
setActive:YES
error:nil];Background location: CLLocationManager
*
locationManager
=
[[CLLocationManager
alloc]
init]; locationManager.delegate
=
self; locationManager.desiredAccuracy
=
kCLLocationAccuracyBest; [locationManager
startUpdatingLocation];
    44. 44. Background audio: NSData
*
data
=
[self
loadDataFile:@"/We
will
rok
you.mp3"]; AVAudioPlayer
*
player
=
[[AVAudioPlayer
alloc]
initWithData:data
error:nil
]; [player
play]; AVAudioSession
*session
=
[AVAudioSession
sharedInstance]; [session
setCategory:AVAudioSessionCategoryPlayback
error:nil]; [session
setActive:YES
error:nil];Background location: CLLocationManager
*
locationManager
=
[[CLLocationManager
alloc]
init]; locationManager.delegate
=
self; locationManager.desiredAccuracy
=
kCLLocationAccuracyBest; [locationManager
startUpdatingLocation];Voice over IP: ???
    45. 45. Task finishing
    46. 46. Task finishing До 10 минут
    47. 47. Task finishing До 10 минутUIBackgroundTaskIden0fier
identifer
=
[[UIApplication
sharedApplication]

 
 

 
 
 
 




beginBackgroundTaskWithExpirationHandler:^{
}];
    48. 48. Вопросы?
    49. 49. Спасибо!

    ×