This file contains 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
-(void)URLPostRequest:(NSString *)stringData success:(void (^)(id responseDict))success failure:(void (^)(NSString *error))failure { | |
NSURL *url = [NSURL URLWithString:@"yoururladdresshere"]; //Set the url | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0]; // Set Timeout Interval = 1 minute | |
[request setValue:@"text/json; charset=utf-8" forHTTPHeaderField:@"Content-Type"]; // Set Charset Type | |
[request addValue:@"application/json" forHTTPHeaderField:@"Accept"]; // Set Packet Type | |
request.HTTPMethod = @"POST"; // Set Method | |
request.HTTPBody = [stringData dataUsingEncoding:NSUTF8StringEncoding]; // Our data to Post |
This file contains 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 AlarmBroadcast extends BroadcastReceiver { | |
final public static String ONE_TIME = "onetime"; | |
//При получении сигнала о срабатывании уведомления | |
@Override | |
public void onReceive(Context context, Intent intent) { | |
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); //Получаем соответствующий сервис | |
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Ваше сообщение в уведомлении"); // Создаем уведомление |
This file contains 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 "ASCIICounter.h" | |
static const int kASCIISymbolsCount = 256; | |
char* fillMappingArrayInSequence(char* str, int size, char* asciiMappingArray) { | |
for (int currentSymbolPosition = 0; currentSymbolPosition < size; currentSymbolPosition++) { | |
asciiMappingArray[str[currentSymbolPosition]]++; | |
} | |
return asciiMappingArray; |
This file contains 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 async Task WriteToFile(string key, string foldername, string filename) | |
{ | |
// Get the text data from the textbox. | |
byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(key.ToCharArray()); | |
// Get the local folder. | |
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder; | |
// Create a new folder name DataFolder. | |
var dataFolder = await local.CreateFolderAsync(Path.Combine("DataFolder", foldername), CreationCollisionOption.OpenIfExists); | |
// Create a new file named DataFile.txt. | |
var file = await dataFolder.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting); |
This file contains 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
@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { | |
super.onRequestPermissionsResult(requestCode, permissions, grantResults); | |
switch (requestCode) { | |
case LOCATION_REQUEST: { | |
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { | |
viewModel.setLocationState(ComposeViewModel.LOCATION_ON); | |
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(mActivity); | |
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != | |
PackageManager.PERMISSION_GRANTED && |
This file contains 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
// | |
// BaseRouting.swift | |
// sddclient | |
// | |
// Created by Гладков Алексей on 10.04.18. | |
// Copyright © 2018 SDD LLC. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains 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
// | |
// SubscriptionsRouter.swift | |
// sddclient | |
// | |
// Created by Гладков Алексей on 10.04.18. | |
// Copyright © 2018 SDD LLC. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
This file contains 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 io.reactivex.Observable | |
import io.reactivex.Single | |
import ru.sddhelp.base.BaseConverter | |
import ru.sddhelp.data.providers.models.ApiLogin | |
import ru.sddhelp.data.providers.models.ApiPhone | |
import ru.sddhelp.data.providers.models.ApiResponse | |
import ru.sddhelp.data.providers.services.RemoteLoginService | |
import javax.inject.Inject | |
/** |
This file contains 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 ru.sddhelp.data.providers.services | |
import io.reactivex.Observable | |
import io.reactivex.Single | |
import retrofit2.http.Field | |
import retrofit2.http.FormUrlEncoded | |
import retrofit2.http.POST | |
import ru.sddhelp.data.providers.models.ApiId | |
import ru.sddhelp.data.providers.models.ApiOrder | |
import ru.sddhelp.data.providers.models.ApiResponse |
This file contains 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 bsh.StringUtil | |
import io.reactivex.Observable | |
import io.reactivex.Single | |
import ru.sddhelp.data.providers.LoginProvider | |
import ru.sddhelp.data.providers.LoginProviderImpl | |
import ru.sddhelp.data.providers.ProfileProvider | |
import ru.sddhelp.data.providers.ProfileProviderImpl | |
import ru.sddhelp.data.providers.models.* | |
import ru.sddhelp.domain.contracts.RemoteContract | |
import ru.sddhelp.domain.repositories.AuthRepository |
OlderNewer