Libetia A

Libetia A

1569225989

How to Create a Machine Learning Mobile App with Angular

Machine learning is becoming increasingly prevalent in modern applications, and it’s easier than you think to incorporate it into your mobile app with minimal coding. To work with machine learning concepts we need data to be analyzed. We can also do funny things with this concept, like analyzing your smile to determine how funny you think something is. Wouldn’t it be cool if we could quickly build an app that made using basic machine learning concepts easy? To show you how simple it can be, let’s walk through what it takes to create an app using machine learning with the popular JavaScript framework, Angular, and the Progress Kinvey high productivity platform.

Our app will be called the Joke-O-Matic app, where you can check your “smile factor” just by capturing your picture with your phone, or selecting a picture you’ve already taken. The app will display a number of jokes and ask you to upload a picture of your reaction, and it will use machine learning to analyze your smile and tell you just how funny you thought the joke was.

Our app will also be able to find out how funny other users think the joke is, and then visualize our results on a graph, letting us know what the average “funniness” is for any given joke. I think this app will be gold for standup comedians everywhere. Let’s dive in.

Setting up the Kinvey Console

This application needs a high-performing backend to store the data we’re going to accumulate, and to help us quickly access our data when we need to show graphs or filter the data.

Kinvey Setup

Kinvey is fast and easy to use for the backend. Within the Kinvey console you can easily use Business Logic, Custom endpoints, Scheduled code or MIC (Mobile Identity Connect). You can also create a collection through Kinvey’s datastore or import other platforms’ data, and much more.

The first step is to login or sign up on the Kinvey console. If you’re new to Kinvey, you can sign up for the Developer edition, which is free forever.

Create a new app by clicking +Add an app button on top right corner of the screen. After clicking on the button you will see the dialog box just like the image below.

And then on the home screen of the Kinvey console create a collection by clicking on +Add a collection button. Once you’ve done this, you’re done with the Kinvey console for now. Your backend is now created, but you don’t have anything in your datastore yet. We’ll return to the console once you do.

Setting up the Frontend

Now let’s download NativeScript Sidekick, which will give us an excellent development experience to create this app.

Login to/Signup for Sidekick, and then start by clicking the “create an app” button. After that you will see this screen.

Sidekick has a wide array of choices for building an app. You can choose from a variety of Templates as well as multiple Project Types, like Angular & TypeScript, TypeScript or JavaScript. Choose whichever options you are most comfortable with.

For this application I have used Angular & Typescript and the Blank Template design.

Next, create your application and open it in a code editor.

Note that we want to use Machine Learning concepts like face detection and image labeling in our app. For that, we will need to use Firebase MLkit in our application.

Setting up Firebase

To get started with Firebase first you need to add a plugin to your app. We have an easy way to use a NativeScript plugin for Firebase.

To use this plugin, you’ll need to make sure you have a Firebase account first.

Go to “https://console.firebase.google.com/” and either register for an account or sign in if you have not done so already. Add a new project by clicking on the “Add project” button.

Once you’ve created your Firebase account, head back to NativeScript Sidekick. Click on the option to “Get started by adding Firebase to your app,” and select your platform: iOS, Android or both.

Now navigate through your application’s package.json file and copy your nativescript id, which should read: “org.nativescript.NAME_of_App”.

Here my package name is “org.nativescript.camac”.

Next, paste it on iOS bundle id under registering your app with Firebase.

As you complete registration of the app, Firebase will generate a config file named “GoogleService-Info.plist”.

Download the “GoogleService-Info.plist” file and put it in your project path at app/App_Resources/iOS/GoogleService-Info.plist.

Add this plugin by running the following command in your app terminal.

tns plugin add nativescript-plugin-firebase

This plugin will ask you specific questions, like which services you would like to install with it. You can say “No” to every feature except MLkit. MLKit is required to install Face Detection and Image Labeling in your app.

After that open your Kinvey console, and from the Dashboard find your App Key and App Secret.

Go to your app component file and initialize Kinvey by writing this snippet.

import { Kinvey , CacheStore } from 'kinvey-nativescript-sdk';
Kinvey.init({
    appKey: " kid_HJiukDq5X",
    appSecret: " 239cbe5644034b10b77b47469701a1b1",
});

We are now all set with configuration, so let’s get coding!

Here is the first page of the application.

This is the list of jokes. So, when a user likes a particular joke, he/she clicks on that joke.

For this list you can use a listview. And in the Array list, you can push each joke so we can display it.

this.jokes = [];
        for(let i=0; i<myjokes.length;i++){
            this.jokes.push(new joke(myjokes[i]));
        }

Note that here you have to be logged in all the time to use the backend with Kinvey.

To make staying logged in easier, you can add this sample to your home component or app component.

if(Kinvey.User.getActiveUser()){
           console.log("Active user");
           }
           else{
            Kinvey.User.login("admin","admin").then(()=>{
                console.log("Will be active");
                }).catch((e)=>{
                    alert(e);
                });
            }

To log in using the code snippet you have to create a user in the Kinvey console with both the user and password being “admin”.

Next, when users click on a specific joke it will redirect them to the next component, which is the heart of the app.

public onItemTap(args) {
            myGlobals.UrlComponent.urlArray = args.index;
            this._routerExtensions.navigate(['/home']);
            console.log("Item Tapped at cell index: " + args.index);
         }

Now you have moved the user to the ‘home’ component from the ‘list’ component. Here you’ll need to use some plugins again to make it work as it supposed to. These are necessary to natively access the camera and image gallery.

import * as Camera from "nativescript-camera";
import * as ImagePicker from "nativescript-imagepicker";

Next you’ll add some additional code, so you can capture a picture or select an image from your phone’s local storage. This way, when a user reads a joke and clicks on the joke, you can have the app capture or upload a picture of your face to calculate your smile percentage.

fromCameraPicture(): void {
        if (!isIOS) {
          Camera.requestPermissions();
        }
        Camera.takePicture({
          width: 800,
          height: 800,
          keepAspectRatio: true,
          saveToGallery: true,
          cameraFacing: "rear"
        }).then(imageAsset => {
          new ImageSource().fromAsset(imageAsset).then(imageSource => {
            this.pickedImage = imageSource;
            setTimeout(() => this.selectMLKitFeature(imageSource), 500);
          });
        });
    }
    fromCameraroll(): void {
        const imagePicker = ImagePicker.create({
          mode: "single"
        });
        imagePicker
            .authorize()
            .then(() => imagePicker.present())
            .then((selection: Array<ImageAsset>) => {
              if (selection.length === 0) return;
     
              const selected = selection[0];
              selected.options.height = 800;
              selected.options.width = 800;
              selected.options.keepAspectRatio = true;
              selected.getImageAsync((image: any, error: any) => {
                if (error) {
                  console.log(`Error getting image source from picker: ${error}`);
                  return;  }
                if (!image) {
                  alert({
                    title: `Invalid image`,
                    message: `Invalid`,
                    okButtonText: "ok."
                  });
                  return; }
                const imageSource = new ImageSource();
                imageSource.setNativeSource(image);
                this.zone.run(() => {
                  this.pickedImage = imageSource;
                });
                 
                setTimeout(() => this.selectMLKitFeature(imageSource), 500);
              });
            })
            .catch(e => {
              console.log(`Image Picker error: ${e}`);
            });
      }

You should be able to either capture or upload a picture now. Here is a screenshot showing what that screen will look like.


By clicking on Gallery, you can select any picture from your camera roll. Alternatively, by selecting the camera, the user can open their device’s camera. And it will display the percentage and visualize it with a progress bar, to show you how funny it is based on your smile.

You can change it too if you don’t like the current picture.

Now let’s get back to home page, where you can find the list of jokes. On the list view there is a segmented bar. You can navigate to the “most funny” segmented page. There will be a graph which shows a bar chart containing each joke and the average value of each users’ funniness rating. Here’s a screenshot of that page.

Whenever you tap on a particular bar, it will show up tool-tip with the text of that specific joke.

Setting up the Chart

NativeScript also has an amazing UI plugin for adding a variety of different charts, and it is so simple and easy to use. Start by running the following command:

tns plugin add nativescript-ui-chart

In order to create a chart, we need to format the data as the chart requires. And to format the data, we will have to first gather it and sync it with our Kinvey datastore. Let’s set up our datastore below.

Syncing your Data with a Kinvey Datastore

Before we sync data to the datastore we need to add two columns to the datastore: one for jokes number and another for percentage. That way you can store your data in the proper column.

We can store the joke number and its different values in the Kinvey backend.

const entity = {_id:null, jnum:myGlobals.UrlComponent.urlArray,percentage:this.confidence};
              const promise = this.dataStore.save(entity)
                .then((entity: {}) => {
                  // ...
                })
                .catch((error: Kinvey.BaseError) => {
                  // ...
                });
                const promise1 = this.dataStore.sync()
              .then(() => {
              })

By using this snippet, you should be able to store and sync data to your backend.

And we are passing jokes number index in ‘jnum’ and its confidence value in ‘percentage’ under entity.

Note that we should give id as ‘null’ because we want to store different values, not just one for each joke.

Here is the screenshot of the data.

This is the whole datastore in the Kinvey console.

To get the result and pass it to the graph we can use this code below.

const aggregation = Kinvey.Aggregation.average("percentage").by("jnum");
  return this.dataStore.group(aggregation).subscribe(
      d => {this.myjokes = d});

Using this code, our collection will be filtered by each joke’s average funniness value. And this json format data we can pass to the ‘myjokes.’

Finally, we can pass this to draw a chart.

And for the tool-tip of each bar we can use this HTML tag.

<Trackball tkCartesianTrackball snapMode="AllClosestPoints" showIntersectionPoints="true" textWrap="true" (trackBallContentRequested)="onTrackBallContentRequested($event)"></Trackball>

That’s how quickly we can build a mobile app that utilizes machine learning. Combining Kinvey with NativeScript we can build a powerful and incredibly fast application with relatively little code. Kinvey has great documentation here to help you get started with NativeScript, but you can also try a different platform as per your requirements.

I hope this tutorial helps you to build your own mobile apps with Kinvey, NativeScript, and Firebase MLKit. I have pushed whole project to GitHub just in case you would like to look at the source code. If you still have some questions, you can reach out to support or feel free to leave comments below.

This post was originally published here

Thanks For Visiting, Keep Visiting!

#machine-learning #angular #mobile-apps #web-development

What is GEEK

Buddha Community

How to Create a Machine Learning Mobile App with Angular
Easter  Deckow

Easter Deckow

1655630160

PyTumblr: A Python Tumblr API v2 Client

PyTumblr

Installation

Install via pip:

$ pip install pytumblr

Install from source:

$ git clone https://github.com/tumblr/pytumblr.git
$ cd pytumblr
$ python setup.py install

Usage

Create a client

A pytumblr.TumblrRestClient is the object you'll make all of your calls to the Tumblr API through. Creating one is this easy:

client = pytumblr.TumblrRestClient(
    '<consumer_key>',
    '<consumer_secret>',
    '<oauth_token>',
    '<oauth_secret>',
)

client.info() # Grabs the current user information

Two easy ways to get your credentials to are:

  1. The built-in interactive_console.py tool (if you already have a consumer key & secret)
  2. The Tumblr API console at https://api.tumblr.com/console
  3. Get sample login code at https://api.tumblr.com/console/calls/user/info

Supported Methods

User Methods

client.info() # get information about the authenticating user
client.dashboard() # get the dashboard for the authenticating user
client.likes() # get the likes for the authenticating user
client.following() # get the blogs followed by the authenticating user

client.follow('codingjester.tumblr.com') # follow a blog
client.unfollow('codingjester.tumblr.com') # unfollow a blog

client.like(id, reblogkey) # like a post
client.unlike(id, reblogkey) # unlike a post

Blog Methods

client.blog_info(blogName) # get information about a blog
client.posts(blogName, **params) # get posts for a blog
client.avatar(blogName) # get the avatar for a blog
client.blog_likes(blogName) # get the likes on a blog
client.followers(blogName) # get the followers of a blog
client.blog_following(blogName) # get the publicly exposed blogs that [blogName] follows
client.queue(blogName) # get the queue for a given blog
client.submission(blogName) # get the submissions for a given blog

Post Methods

Creating posts

PyTumblr lets you create all of the various types that Tumblr supports. When using these types there are a few defaults that are able to be used with any post type.

The default supported types are described below.

  • state - a string, the state of the post. Supported types are published, draft, queue, private
  • tags - a list, a list of strings that you want tagged on the post. eg: ["testing", "magic", "1"]
  • tweet - a string, the string of the customized tweet you want. eg: "Man I love my mega awesome post!"
  • date - a string, the customized GMT that you want
  • format - a string, the format that your post is in. Support types are html or markdown
  • slug - a string, the slug for the url of the post you want

We'll show examples throughout of these default examples while showcasing all the specific post types.

Creating a photo post

Creating a photo post supports a bunch of different options plus the described default options * caption - a string, the user supplied caption * link - a string, the "click-through" url for the photo * source - a string, the url for the photo you want to use (use this or the data parameter) * data - a list or string, a list of filepaths or a single file path for multipart file upload

#Creates a photo post using a source URL
client.create_photo(blogName, state="published", tags=["testing", "ok"],
                    source="https://68.media.tumblr.com/b965fbb2e501610a29d80ffb6fb3e1ad/tumblr_n55vdeTse11rn1906o1_500.jpg")

#Creates a photo post using a local filepath
client.create_photo(blogName, state="queue", tags=["testing", "ok"],
                    tweet="Woah this is an incredible sweet post [URL]",
                    data="/Users/johnb/path/to/my/image.jpg")

#Creates a photoset post using several local filepaths
client.create_photo(blogName, state="draft", tags=["jb is cool"], format="markdown",
                    data=["/Users/johnb/path/to/my/image.jpg", "/Users/johnb/Pictures/kittens.jpg"],
                    caption="## Mega sweet kittens")

Creating a text post

Creating a text post supports the same options as default and just a two other parameters * title - a string, the optional title for the post. Supports markdown or html * body - a string, the body of the of the post. Supports markdown or html

#Creating a text post
client.create_text(blogName, state="published", slug="testing-text-posts", title="Testing", body="testing1 2 3 4")

Creating a quote post

Creating a quote post supports the same options as default and two other parameter * quote - a string, the full text of the qote. Supports markdown or html * source - a string, the cited source. HTML supported

#Creating a quote post
client.create_quote(blogName, state="queue", quote="I am the Walrus", source="Ringo")

Creating a link post

  • title - a string, the title of post that you want. Supports HTML entities.
  • url - a string, the url that you want to create a link post for.
  • description - a string, the desciption of the link that you have
#Create a link post
client.create_link(blogName, title="I like to search things, you should too.", url="https://duckduckgo.com",
                   description="Search is pretty cool when a duck does it.")

Creating a chat post

Creating a chat post supports the same options as default and two other parameters * title - a string, the title of the chat post * conversation - a string, the text of the conversation/chat, with diablog labels (no html)

#Create a chat post
chat = """John: Testing can be fun!
Renee: Testing is tedious and so are you.
John: Aw.
"""
client.create_chat(blogName, title="Renee just doesn't understand.", conversation=chat, tags=["renee", "testing"])

Creating an audio post

Creating an audio post allows for all default options and a has 3 other parameters. The only thing to keep in mind while dealing with audio posts is to make sure that you use the external_url parameter or data. You cannot use both at the same time. * caption - a string, the caption for your post * external_url - a string, the url of the site that hosts the audio file * data - a string, the filepath of the audio file you want to upload to Tumblr

#Creating an audio file
client.create_audio(blogName, caption="Rock out.", data="/Users/johnb/Music/my/new/sweet/album.mp3")

#lets use soundcloud!
client.create_audio(blogName, caption="Mega rock out.", external_url="https://soundcloud.com/skrillex/sets/recess")

Creating a video post

Creating a video post allows for all default options and has three other options. Like the other post types, it has some restrictions. You cannot use the embed and data parameters at the same time. * caption - a string, the caption for your post * embed - a string, the HTML embed code for the video * data - a string, the path of the file you want to upload

#Creating an upload from YouTube
client.create_video(blogName, caption="Jon Snow. Mega ridiculous sword.",
                    embed="http://www.youtube.com/watch?v=40pUYLacrj4")

#Creating a video post from local file
client.create_video(blogName, caption="testing", data="/Users/johnb/testing/ok/blah.mov")

Editing a post

Updating a post requires you knowing what type a post you're updating. You'll be able to supply to the post any of the options given above for updates.

client.edit_post(blogName, id=post_id, type="text", title="Updated")
client.edit_post(blogName, id=post_id, type="photo", data="/Users/johnb/mega/awesome.jpg")

Reblogging a Post

Reblogging a post just requires knowing the post id and the reblog key, which is supplied in the JSON of any post object.

client.reblog(blogName, id=125356, reblog_key="reblog_key")

Deleting a post

Deleting just requires that you own the post and have the post id

client.delete_post(blogName, 123456) # Deletes your post :(

A note on tags: When passing tags, as params, please pass them as a list (not a comma-separated string):

client.create_text(blogName, tags=['hello', 'world'], ...)

Getting notes for a post

In order to get the notes for a post, you need to have the post id and the blog that it is on.

data = client.notes(blogName, id='123456')

The results include a timestamp you can use to make future calls.

data = client.notes(blogName, id='123456', before_timestamp=data["_links"]["next"]["query_params"]["before_timestamp"])

Tagged Methods

# get posts with a given tag
client.tagged(tag, **params)

Using the interactive console

This client comes with a nice interactive console to run you through the OAuth process, grab your tokens (and store them for future use).

You'll need pyyaml installed to run it, but then it's just:

$ python interactive-console.py

and away you go! Tokens are stored in ~/.tumblr and are also shared by other Tumblr API clients like the Ruby client.

Running tests

The tests (and coverage reports) are run with nose, like this:

python setup.py test

Author: tumblr
Source Code: https://github.com/tumblr/pytumblr
License: Apache-2.0 license

#python #api 

Autumn  Blick

Autumn Blick

1594770710

How To Succeed In Mobile App Wireframe Design?

In the world of overrated terms “web development”, a mobile app wireframe design is one of the most underrated terms. The design of wireframes is considered when people look for the bigger picture.

While designing the UI-UX, people forget the simple norm of general to specific shifting. As the complexity increases and so does the approach become more difficult, this is where the designing of the wireframes comes in handy.

Before diving into the “How to”, let’s first see why we need them in the first place.

What are mobile app wireframes?

Wireframes are the skeletal layouts of an application or a website that is being designed. The specificity comes into play, the elements and the features have to be placed at specific locations. Take a building, in the process of making it, first the foundation is laid and then pieces are fitted together from the skeleton structure on a piece of paper, wireframes do the same for the website or application structure such as a smart home application.

The designing of wireframes is commonly known as wireframing. For the construction of a building, the framework or the skeletal structure is important while designing a web application or mobile application, wireframing is important to make it user-friendly. This entirely and solely works to make the journey smooth and destination easy to reach.

As for the building, the layers of cementing and painting is done later to increase the visual appeal, the visual contents and appealing stuff are added after wireframing. The simpler it sounds after the definition, the complex it gets when it is being done.

It is a very goal-oriented procedure, one has to keep in mind is the goal of the product or the destination of the service. The main focus should be on UX. The arrangement of the elements and their interaction with each other and with the user is the utmost important task in mobile app wireframing.

What not to do while designing the mobile app wireframe?

  • Do not even think of skipping the process.
  • Do not beautify (visually appealing designs added first) and then get into the wireframing business).
  • Do not do it just for the sake of doing it.

One has to keep in mind that skipping this entirely can lead to the failure of the entire process of web and mobile app development at the end.

Again taking the example of the construction of a building, the foundation must be laid first based on the skeletal framework that has been prepared, then only you can jump to beautify your building, as a designer one has to understand and follow the steps where designing the mobile app wireframe comes first and then the visually appealing content is added next not the other way round.

For the most part, people do not understand the importance and come up with some trashy design of wireframes and the main foundation becomes faulty, hence the entire designing at later stages becomes faulty. If one wants to skip the reworking part, mobile app wireframing must never be ignored.

#android app #ios app #minimum viable product (mvp) #mobile app development #app designing #mobile app wireframe designing #mobile app wireframing #mobile application wireframing #mobile wireframing #web app wireframing #wireframe designing

Jones Brianna

Jones Brianna

1614154249

List Of The Top Pittsburgh Mobile App Development Companies

https://clutch.co/app-developers/pittsburgh
Let’s look at the list of top list of the top Pittsburgh mobile app development companies which are known for providing top-notch services globally. They are great developers who provide quality services for all your needs.

#mobile app developers #mobile app development services #mobile app development #mobile app developers #mobile apps #mobile app development solutions

Jones Brianna

Jones Brianna

1608183156

Top 10 Mobile App Development Companies in India

https://yourstory.com/mystory/top-10-mobile-app-development-companies-in-india-djq13xfgd8

Here’s a rundown of Top 10 mobile app development companies in India, carefully evaluated on the various performance indicators based on proven track record and diversified portfolio, quality of end-product, experience, core technical expertise, project management strategy, adherence to timelines and budget, app prototyping and UI/UX design.

#mobile app development #mobile app development company #mobile app development services #mobile app developers #mobile app development solutions #mobile apps

How much does it cost to create an online learning app?

Are you thinking of executing an E-learning app in the market?

Then firstly you need to understand the concept of E-learning in more detail and also know about the types of E-learning app and what is the E-learning app demand in the market.

In this present time, every industry is taking the help of technology for maximizing their profits, as people love to use the technology for fulfilling their basic requirements. Every industry is now providing online services via web apps or mobile apps.

What are the Basic features an E-learning app contains?

Features list for a learner Panel:

  • Easy registration and login module for learners.
  • Easy navigation to the courses and study material
  • Can able to search various courses by applying various filters
  • Can get notify whenever a new course is added to the platform.
  • Can purchase the courses by doing online payment
  • Can access the quiz test and mock test services
  • Learners can post questions and answer
  • Learner can directly chat with the tutor for clearing doubts.
  • Learner can check their history or list of purchased courses.
  • Learner can easily track their progress by reports which is generated in-app.

Features list for a tutor Panel:

  • Tutor can easily set up and manage their account
  • Tutor can easily update or modify their uploaded courses.
  • Tutor get notify whenever any learner has posted a question
  • Tutor can manage the payment module
  • Tutor can clear the doubts of the learner by chat module.

Feature list for an Admin Panel:

  • Admin can do the learners data management
  • Admin can do the tutor data management
  • Can manage the courses
  • Manage and define the categories or Subcategories of courses.
  • Manage the premium and subscription packages.
  • Payment management
  • Manage the chats and discussion forum.
  • Content management system
  • Able to generate reports and do analysis.

What are the factors on which the cost of the E-learning app depends?

The cost of the E-learning app is depended on some of the factors. Let me list down the factors affecting the cost of an E-learning app:

  • The Cost of an E-learning is depended on the UI/UX design of the app.
  • Cost also depends on the size of the app.
  • The features or functionality you want to add in your E-learning app
  • The cost highly depends on the platform which is chosen for the development of an E-learning app it can be in Android, IOS or Both.

How much does it cost to develop an E-learning app?

As we have discussed the cost of an E-learning app is highly depends on some of the factors. We are at AppClues Infotech, which is a leading app development industry. We help you to develop an E-learning app by providing you with the best solution and Unique UI/UX design.

We can offer you to hire experienced and expert android as well as an IOS developer.

So here we are providing you with the approximate timeline and cost of developing an E-learning app:

Timeline:

  • App Design:- 7 Working Days
  • Android App Development:- 25 Working Days
  • iOS App Development:- 25 Working Days
  • Web Backend & Apis:- 30 Working Days
  • Testing, Bug fixing, and Deployment:- 5 Working Days

Costing:
The approximate cost of developing an E-learning app is $30,000-$70,000.

#how much does it cost to develop an e-learning app #how much does it cost to create e-learning #how much does it cost to develop a educational app #how much does cost to make an e-learning app #how to create an educational app #e-learning mobile app development cost and features