Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Anjali_VIT-AP/Intents_serialization assignment/Intents/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
/entry/.preview
.cxx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.huawei.ohos.app'

//For instructions on signature configuration, see https://developer.harmonyos.com/en/docs/documentation/doc-guides/ide_debug_device-0000001053822404#EN-US_TOPIC_0000001154985555__section1112183053510
ohos {
compileSdkVersion 5
defaultConfig {
compatibleSdkVersion 5
}
}

buildscript {
repositories {
maven {
url 'https://repo.huaweicloud.com/repository/maven/'
}
maven {
url 'https://developer.huawei.com/repo/'
}
jcenter()
}
dependencies {
classpath 'com.huawei.ohos:hap:2.4.4.2'
classpath 'com.huawei.ohos:decctest:1.2.4.0'
}
}

allprojects {
repositories {
maven {
url 'https://repo.huaweicloud.com/repository/maven/'
}
maven {
url 'https://developer.huawei.com/repo/'
}
jcenter()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apply plugin: 'com.huawei.ohos.hap'
apply plugin: 'com.huawei.ohos.decctest'
//For instructions on signature configuration, see https://developer.harmonyos.com/en/docs/documentation/doc-guides/ide_debug_device-0000001053822404#EN-US_TOPIC_0000001154985555__section1112183053510
ohos {
compileSdkVersion 5
defaultConfig {
compatibleSdkVersion 5
}
buildTypes {
release {
proguardOpt {
proguardEnabled false
rulesFiles 'proguard-rules.pro'
}
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
testImplementation 'junit:junit:4.13'
ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
}
decc {
supportType = ['html','xml']
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# config module specific ProGuard rules here.
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"app": {
"bundleName": "com.example.intents",
"vendor": "example",
"version": {
"code": 1000000,
"name": "1.0.0"
}
},
"deviceConfig": {},
"module": {
"package": "com.example.intents",
"name": ".MyApplication",
"mainAbility": "com.example.intents.MainAbility",
"deviceType": [
"phone",
"tablet",
"tv"
],
"distro": {
"deliveryWithInstall": true,
"moduleName": "entry",
"moduleType": "entry",
"installationFree": false
},
"abilities": [
{
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
],
"orientation": "unspecified",
"name": "com.example.intents.MainAbility",
"icon": "$media:icon",
"description": "$string:mainability_description",
"label": "$string:entry_MainAbility",
"type": "page",
"launchType": "standard"
},
{
"orientation": "unspecified",
"name": "com.example.intents.SecondAbility",
"icon": "$media:icon",
"description": "$string:secondability_description",
"label": "$string:entry_SecondAbility",
"type": "page",
"launchType": "standard"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.example.intents;

import com.example.intents.slice.MainAbilitySlice;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;

public class MainAbility extends Ability {
@Override
public void onStart(Intent intent) {
super.onStart(intent);
super.setMainRoute(MainAbilitySlice.class.getName());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.intents;

import ohos.aafwk.ability.AbilityPackage;

public class MyApplication extends AbilityPackage {
@Override
public void onInitialize() {
super.onInitialize();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.example.intents;


import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Text;

public class SecondAbility extends Ability {

Text userInfoName;
Text userInfoRoll;
Text userInfoUniversity;
Text userInfoDepartment;


// intent.setParam("user_info_name", user.getStudentName());
// intent.setParam("user_info_roll", user.getRollNo());
// intent.setParam("user_info_Department", user.getDepartmentName());
// intent.setParam("user_info_college", user.getCollegeName());
// intent.setParam("user_info_university", user.getUniversityName());

@Override
protected void onStart(Intent intent) {
super.onStart(intent);
super.setUIContent (ResourceTable.Layout_ability_next);
initViews (intent);

}

private void initViews (Intent intent) {
userInfoName = (Text) findComponentById(ResourceTable.Id_user_info_name);
userInfoRoll = (Text) findComponentById(ResourceTable.Id_user_info_roll);
userInfoUniversity = (Text) findComponentById(ResourceTable.Id_user_info_university);
userInfoDepartment = (Text) findComponentById(ResourceTable.Id_user_info_Department);

if (intent != null) {
userInfoName.setText(intent.getStringParam("user_info_name"));
userInfoRoll.setText(intent.getStringParam("user_info_roll"));
userInfoUniversity.setText(intent.getStringParam("user_info_university"));
userInfoDepartment.setText(intent.getStringParam("user_info_Department"));
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.example.intents.data;

import ohos.aafwk.content.Intent;

public class User{


private String studentName;

private String departmentName;

private String collegeName;

private String universityName;

private String rollNo;

public String getStudentName() {
return studentName;
}

public void setStudentName(String studentName) {
this.studentName = studentName;
}

public String getDepartmentName() {
return departmentName;
}

public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}

public String getCollegeName() {
return collegeName;
}

public void setCollegeName (String collegeName) {
this.collegeName = collegeName;
}

public String getUniversityName() { return universityName; }

public void setUniversityName (String universityName) { this.universityName = universityName;}

public String getRollNo() { return rollNo; }

public void setRollNo (String rollNo) {
this.rollNo=rollNo;
}


}
Loading