This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.1" encoding="utf-8"?> | |
<employees> | |
<employee> | |
<name>Abc</name> | |
</employee> | |
<employee> | |
<name>Xyz</name> | |
</employee> | |
</employees> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jumpbyte.webserver; | |
import java.io.*; | |
import java.net.InetAddress; | |
import java.net.InetSocketAddress; | |
import java.net.ServerSocket; | |
import java.net.Socket; | |
import java.net.SocketException; | |
import java.net.SocketTimeoutException; | |
import java.net.URLDecoder; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jumpbyte.webserver; | |
import android.content.Context; | |
import android.util.Log; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.FileDescriptor; | |
import java.io.FileInputStream; | |
import java.io.FileOutputStream; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVFoundation | |
class PlaySoundsViewController: UIViewController { | |
var audioPlayer: AVAudioPlayer! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVFoundation | |
class RecordSoundsViewController: UIViewController, AVAudioRecorderDelegate { | |
var audioPlayer: AVAudioPlayer | |
@IBAction func recordAudio(sender: UIButton) { | |
let dirPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as? String | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var engine: AVAudioEngine! | |
var file: AVAudioFile! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
engine = AVAudioEngine() | |
audioFile = AVAudioFile(forReading: filePathUrl, error: nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func extractColor(image: UIImage){ | |
let pixel = UnsafeMutablePointer<CUnsignedChar>.alloc(4) | |
let colorSpace:CGColorSpace = CGColorSpaceCreateDeviceRGB() | |
let bitmapInfo = CGBitmapInfo(CGImageAlphaInfo.PremultipliedLast.rawValue) | |
let context = CGBitmapContextCreate(pixel, 1, 1, 8, 4, colorSpace, bitmapInfo) | |
CGContextDrawImage(context, CGRectMake(0, 0, 1, 1), image.CGImage) | |
var color: UIColor? = nil | |
if pixel[3] > 0 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> List<List<T>> split(List<T> list, int size) | |
throws NullPointerException, IllegalArgumentException { | |
if (list == null) { | |
throw new NullPointerException("The list parameter is null."); | |
} | |
if (size <= 0) { | |
throw new IllegalArgumentException( | |
"The size parameter must be more than 0."); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.pm.PackageInfo; | |
/* | |
* Utility class to check whether App is Updated of Fresh Installed | |
*/ | |
public class AppInfoUtil{ | |
public boolean isUpdated() throws Exception{ | |
PackageInfo info = null; | |
info = getPackageManager().getPackageInfo(getPackageName(), 0); | |
return info.firstInstallTime != info.lastUpdateTime; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BadgeUtils { | |
public static void setBadge(Context context, int count) { | |
setBadgeSamsung(context, count); | |
setBadgeSony(context, count); | |
} | |
public static void clearBadge(Context context) { | |
setBadgeSamsung(context, 0); |