Sunday, September 15, 2019

Wednesday, September 11, 2019

Make apk file or build apk file or build in apk file

1. Install android studio version 2.3.2
2. Install jdk "jdk-8u161-windows-x64.exe"
3. Configuration in
     My Computer> Properties>Advance system settings>Advance>Environment Variables>
   System  variables    
   Variable                      Values
   ANDROID_HOME    C:\Users\OMG\AppData\Local\Android\Sdk
   JAVA_HOME             C:\Program Files\Java\jdk1.8.0_161
   Path                             C:\Program Files\Java\jdk1.8.0_161\bin

   User  variables
   User              variables
   PATH            %JAVA_HOME%\bin
                         %ANDROID_HOME%\tools
                         %ANDROID_HOME%\platform-tools



4. Add android Platform in Ionic
    >ionic cordova platform add android

5. Build android apk file or generate apk file
    >ionic cordova build android
   
     

Sunday, September 8, 2019

wmic

C:\Users\OMG>ionic info
Error: Command failed: wmic os get Caption  'wmic' is not recognized as an internal or external command, operable program or batch file.


1. >My Computer> Properties>Advance system settings>Advance>Environment Variables>System variables
Variable  :  Value
Path        :  C:\Windows\System32\wbem\

also resolve link
https://kb.informatica.com/solution/23/Pages/4/156865.aspx



Thursday, September 5, 2019

keytool not find

> keytool
not recognized or not recognised or not find

1. First add jdk bin path in..

My Computer> Properties>Advance system settings>Advance>Environment Variables>System variables

Variable       Value
Path             C:\Program Files\Java\jdk-12.0.2\bin


Ionic serve 'node' is not recognized as an internal or external command, operable program or batch file.

PS E:\E Drive\RND\IONIC\New folder\myIoAppApiGetPostDelUpWithFormEmployee> ionic serve 'node' is not recognized as an internal or external command, operable program or batch file.

To resolve

1.  First Add in
     My Computer> Properties>Advance system settings>Advance>Environment Variables>User variables
add in
Variable  Value
PATH      C:\Program Files\nodejs

2.  Second and  Open Node.js
      and run commad
> SET PATH=C:\Program Files\Nodejs;%PATH%

Wednesday, September 4, 2019

Build ionic to apk

1. Config android sdk
Path is  MyComputer>Properties>Advance system settings>Advance>Environment Variables> User variables for [current user]> add/edit/delete

Variable                      Path
ANDROID_HOME    C:\Users\OMG\AppData\Local\Android\Sdk

ANDROID_HOME=C:\Users\OMG\AppData\Local\Android\Sdk


2.  Apk Debug commad
    > ionic cordova build android --prod --release

Tuesday, August 27, 2019

Get Post Delete Pur

1. Ionic get post delete put commads


import { Component, OnInit } from '@angular/core';

import { HttpClient, HttpHeaders } from '@angular/common/http';

@Component({
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss'],
})
export class HomePage implements OnInit {

url = 'https://localhost:44354/api/employees_';

constructor(private http:HttpClient) { }

ngOnInit() {
// this.getApi();
}

getApi(){
let Headers_ = new HttpHeaders({
'Content-Type': 'application/json'
});
this.http.get(this.url,{headers:Headers_,params:{'Emp_Name':'ri'}})
.subscribe(data => {
console.log('data : '+JSON.stringify(data));

});
}

postApi(){
let Headers_ = new HttpHeaders({
'Content-Type': 'application/json'
});

let jsonData={
"Emp_Name": "Rinkesh Gola",
"Address": "Agra",
"Mobile": "7878"
}
this.http.post(this.url,jsonData,{headers:Headers_})
.subscribe(data => {
console.log('data : '+JSON.stringify(data));

});
}

putApi(){
let Headers_ = new HttpHeaders({
'Content-Type': 'application/json'
});

let jsonData={
"Srno":"51",
"Emp_Name": "Sanjay Gola",
"Address": "Agra",
"Mobile": "99"
}

this.http.put(this.url,jsonData,{headers:Headers_,params:{"id":"51"}})
.subscribe(data => {
console.log('data put : '+JSON.stringify(data));

});
}

deleteApi(){
let Headers_ = new HttpHeaders({
'Content-Type': 'application/json'
});

let jsonData={
"Srno":"50",
"Emp_Name": "Sanjay Gola",
"Address": "Agra",
"Mobile": "99"
}

this.http.delete(this.url,{headers:Headers_,params:{"id":"51"}})
.subscribe(data => {
console.log('data put : '+JSON.stringify(data));

});
}

}



2. Ionic version

PS E:\E Drive\RND\IONIC\myIoAppApiGetPostDelPut> ionic info Ionic: Ionic CLI : 5.2.3 (C:\Users\OMG\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.7.4 @angular-devkit/build-angular : 0.801.3 @angular-devkit/schematics : 8.1.3 @angular/cli : 8.1.3 @ionic/angular-toolkit : 2.0.0 Utility: cordova-res : not installed native-run : 0.2.8 System: NodeJS : v10.16.0 (C:\Program Files\nodejs\node.exe) npm : 6.9.0 OS : Windows 10

Monday, August 19, 2019

Post in ionic 4 or 5 with api with fromUri

1. Post in ionic 4 or 5 with api with fromUri




Code is ...


import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders, HttpErrorResponse } from '@angular/common/http';
import { Observable } from 'rxjs';

@Component({
selector: 'app-create2',
templateUrl: './create2.page.html',
styleUrls: ['./create2.page.scss'],
})
export class Create2Page implements OnInit {

result: any= [];
data: Observable<any>;

constructor(private http: HttpClient) { }

ngOnInit() { }

getData(){
var url = "https://localhost:44354/api/employees_";
// alert("Get data");
this.data = this.http.get(url);
this.data.subscribe(data => {
this.result = data;
console.log(data);
})
}
postData(){
var url = "https://localhost:44354/api/employees_";
var durl="?Emp_Name=RinkeshGola&Address=Agra&Mobile=87878";
this.data = this.http.post(url+encodeURI(durl),"");
this.data.subscribe(data => {
console.log("show data : "+JSON.stringify(data));
})
}
}


Monday, August 12, 2019

Get in ionic 3 or 4 or later or test api get in ionic


import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Component({
selector: 'app-home',
templateUrl: './home.page.html',
styleUrls: ['./home.page.scss'],
})
export class HomePage implements OnInit {

constructor(private http: HttpClient) { }

ngOnInit() {
this.load_data();
}

load_data(){
this.http.get<any[]>('http://local.omgrk.com/api/employees_').subscribe(d => console.log(d));
}

}

Navigation in ionic or redirect in ionic

1.  Redirect as return View in mvc code in .ts       this .router.navigateByUrl( "/rec-view/" +d.Srno,{ skipLocationChange:tru e...