Sunday, September 23, 2018

Siri shortcut use cases

The link in references shows some of the apps in app store that has been updated to provide siri support. 

The Sky guide has a Cool option

This is a particularly cool option. After setting up a shortcut, you can point iPhone at the sky and ask Siri what star is that and she will identify it for you.

Master Job search also has a cool thing to save the Siri shortcuts can be used to save a favorite search so they don't have to type the query inside of Monster each time.

PCalc has a good one too, it allows to add shortcuts to Convert X from inches to centimetres.

References:
https://appleinsider.com/articles/18/09/17/how-your-favorite-apps-are-embracing-siri-shortcuts



Saturday, September 22, 2018

How to make a node js app work with sails js?

A node JS app that essentially has @require flags to define and load dependencies.
Sails JS is a framework built on top of Node JS. The dependencies are defined in package.json and the same package names defined in Sails JS can be pulled into the package.json of sails and place the html files in the view folder and thats it pretty much. before running, do an npm install, so that the dependencies are installed.

Enrolling for iOS developer program

there are 3 types of iOS developer program

1. iOS Developer program (99$ per year)
2. iOS Enterprise Developer program (299$ per year)
3. iOS University Developer program (Free)

iOS Developer program enables a developer to distribute apps on app store. Extend the ability to generate revenue from a developer's app on the app store with in-app purchase, iAd rich media ads, volume purchases and more.

there are mainly two enrollment types

1. Individual: this is if individual or sole proprietor or owner of business
2. company/organization: if it is a company, non profit organization, joint venture, partnership or government organization

Need to provide basic information about the enity who is enrolling. if its an organization, then the D-N-
U number etc. 

Typical Configurations in a Hotspot Redirector.

ZoneDirector is typical implementation of how a Redirector works. This redirector works with RADIUS, Web portal etc. Below are requirements for implementations such as ZoneDirector. 

- External Web server (such as Apache, IIS, or equivalent) with properly configured login portal page. 
- Local Directory, Active Directory, LDAP or RADIUS authentication server (RADIUS is preferred by many) 
- An Accounting server such as RADIUS 

Below are typical setup process in a Redirector

- Configure the AAA server. If we have selected RADIUS, we need to provide this here
- Configure the Accounting server, This is optional, required only if the operator is interested in knowing the details of the upload / download and other parameters 
- Configure a Hotspot with its name, Login page url ( the login url will be used to redirect unauthenticated users. This url will be added to the walled garden by the redirector automatically), a Start page (Page which is used for redirecting after the authentication is successful.) Session timeout (IF specified, the users will be automatically signed out when the session time elapsed. Sometimes RADIUS server also can specify the session timeout, if this is the case, this will be the value of the timeout.), Idle timeout, 

How does the Android build system find the dependancies?

I met with this error
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.google.firebase:firebase-core:11.8.1

It claimed to say that it looked in the folder file:/Users/bond/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-core/11.8.1/
and manually navigating to this folder yes, I could not see the firebase stuff.

I checked the SDK location base path in the project structure dialog under SDK location, and the base path is same as the
one shown in the error where system tried to look for firebase.

/Users/bond/Library/Android/sdk

Also, another project in the same system for the same version is not giving this error and I remember earlier 11.8 compiled.

when i checked, the build.gradle has below,

compile 'com.google.firebase:firebase-core:11.8.1'
    compile 'com.google.firebase:firebase-messaging:11.8.0'
    compile 'com.google.android.gms:play-services:11.8.0'


and changed to implementation like below which actually seems to have resolved issue with app but the module still gives the error

Error:(29, 20) Failed to resolve: com.google.firebase:firebase-core:11.8.1
Show in File
Show in Project Structure dialog

One blog post was suggesting to do this, which i already had.

allprojects {
  repositories {
    // ...
    maven { url "https://maven.google.com" }
  }
}




Error:Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.google.firebase:firebase-core:11.8.1.
  Searched in the following locations:
      file:/Users/bond/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Users/bond/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      file:/Users/bond/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Users/bond/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      file:/Users/bond/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Users/bond/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://jcenter.bintray.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://jcenter.bintray.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://maven.google.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://maven.google.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://jitpack.io/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://jitpack.io/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
  Required by:
      project :app
> Could not find com.google.firebase:firebase-core:11.8.1.
  Searched in the following locations:
      file:/Users/bond/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Users/bond/Library/Android/sdk/extras/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      file:/Users/bond/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Users/bond/Library/Android/sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      file:/Users/bond/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Users/bond/Library/Android/sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://jcenter.bintray.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://jcenter.bintray.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://maven.google.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://maven.google.com/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
      https://jitpack.io/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.pom
      https://jitpack.io/com/google/firebase/firebase-core/11.8.1/firebase-core-11.8.1.jar
  Required by:
      project :app > project :appynotifications

AMR WB Codec interface format

Each AMR-WB codec mode follows the generic frame structure depicted in figure 1. The frame is divided into three
parts: AMR-WB Header, AMR-WB Auxiliary Information, and AMR-WB Core Frame. The AMR-WB Header part
includes the Frame Type and the Frame Quality Indicator fields. The AMR-WB auxiliary information part includes the
Mode Indication, Mode Request, and Codec CRC fields.  The AMR-WB Core Frame part consists of the speech
parameter bits or, in case of a comfort noise frame, the comfort noise parameter bits. In case of a comfort noise frame,
the comfort noise parameters replace Class A bits of AMR-WB Core Frame while Class B and C bits are omitted.


references:
https://www.etsi.org/deliver/etsi_ts/126200_126299/126201/05.00.00_60/ts_126201v050000p.pdf

Thursday, September 20, 2018

Flutter Gesture handling


Gestures include tab, dragging, scaling. Gesture handling has two layers, first one is raw pointer event infos. Second layer is the actual gesture, which describe the semantic actions that consists of one or more pointer events.

Pointers represent raw data about the user’s interaction with the device’s screen. There are four types of pointer events:

    PointerDownEvent The pointer has contacted the screen at a particular location.
    PointerMoveEvent The pointer has moved from one location on the screen to another.
    PointerUpEvent The pointer has stopped contacting the screen.
    PointerCancelEvent Input from this pointer is no longer directed towards this app.


Gestures

Gestures represent semantic actions (e.g., tap, drag, and scale) that are recognized from multiple individual pointer events, potentially even multiple individual pointers. Gestures can dispatch multiple events, corresponding to the lifecycle of the gesture (e.g., drag start, drag update, and drag end):

    Tap
        onTapDown A pointer that might cause a tap has contacted the screen at a particular location.
        onTapUp A pointer that will trigger a tap has stopped contacting the screen at a particular location.
        onTap A tap has occurred.
        onTapCancel The pointer that previously triggered the onTapDown will not end up causing a tap.
    Double tap
        onDoubleTap The user has tapped the screen at the same location twice in quick succession.
    Long press
        onLongPress A pointer has remained in contact with the screen at the same location for a long period of time.
    Vertical drag
        onVerticalDragStart A pointer has contacted the screen and might begin to move vertically.
        onVerticalDragUpdate A pointer that is in contact with the screen and moving vertically has moved in the vertical direction.
        onVerticalDragEnd A pointer that was previously in contact with the screen and moving vertically is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen.
    Horizontal drag
        onHorizontalDragStart A pointer has contacted the screen and might begin to move horizontally.
        onHorizontalDragUpdate A pointer that is in contact with the screen and moving horizontally has moved in the horizontal direction.
        onHorizontalDragEnd A pointer that was previously in contact with the screen and moving horizontally is no longer in contact with the screen and was moving at a specific velocity when it stopped contacting the screen.

To listen to gestures from the widgets layer, use a GestureDetector.

class MyButton extends StatelessWidget {
@override
Widget build(BuildContext context){
    return GestureDetector(
        onTap:(){
            print("Button tapped");
        },
        child:Container {
            height:36.0,
            padding: const EdgeInsets.all(8.0),
            margin: const EdgeInsets.symmetric(horizontal:8.0)
'            decoration: BoxDecoration(
                borderRadius : BorderRadius.circular(5.0),
                color : Colors.lightGreen[500],
               
            )
        }
       
    )
}
}


References
https://flutter.io/gestures/