- Why?
- How?
- What?
- When?
Use Google and Youtube search engines. Learn to search for answers for your questions.
Try:
- https://www.google.com/?q=how%20to%20create%20mobile%20applications
- https://www.youtube.com/results?search_query=how+to+create+mobile+applications
Usually Youtube provides very good answers, so step by step, you get smarter, for what to search for.
(Ok, we do some tasks in class, but Youtube is much smarter, than your teacher.)
https://developer.apple.com/swift/
Running either limited set of functionality, or in Webbrowser.
- https://www.swift.org/blog/swift-on-windows/
- https://medium.com/@illescasDaniel/run-swift-on-windows-11-in-2021-675d703e7a91
- https://www.developer.com/microsoft/an-intro-to-swift-programming-on-windows-even/
- https://developer.android.com/studio
- https://developer.android.com/jetpack
- https://developer.android.com/kotlin
- https://developer.android.com/games
To have fast application, that consumes less battery, native solutions are usually better, providing additional features (like running in background) etc.
For application with GUI development:
- https://www.sam-solutions.com/blog/cross-platform-mobile-development/ (summary list)
- https://kotlinlang.org/docs/multiplatform-mobile-getting-started.html
- https://reactnative.dev/
For game development:
Web2.0 application will work in web browser, on any device.
- Create yourself a Github account (for example github.com/your_user_name)
- Create yourself a new public repository and name it your_user_name.github.io (for example for me it is mxrguspxrt.github.io)
- Visit https://mxrguspxrt.github.io/ and your site
- Create yourself a simple homepage using Markdown or HTML
- On this simple homepage write a essay on a subject: "Why I am learning in this school, how I hope it helps me in the future, who I want to be when I grow up"
- Task 5 will be graded on scale of 1-5 before next class. Send me link to your_user_name.github.io.
By the next class:
- Have team
- Have idea for startup and Figma landing page design
- Next class we start with dev env setup and programming!
Today, we will be installing React Native with Expo.
Install Expo: https://docs.expo.dev/get-started/installation/
Read documentation + Install React Native: https://reactnative.dev/docs/environment-setup
- Let's install support for Android: https://developer.android.com/studio (Download Studio + run the installer)
- Let's install support for IOS: https://developer.apple.com/xcode/ (Download XCode + run the installer)
- Let's install support for web:
npx expo install react-native-web@~0.18.7 [email protected] @expo/webpack-config@^0.17.0 # (these are required dependecies)
npx create-expo-app Hello
cd Hello
npm run android
# https://docs.expo.dev/workflow/android-studio-emulator (here are steps you need to do)
npm run ios
# this part will be skipped, if you are on Windows machine. But you can test on some OSX machine on your own.
npx expo install react-native-web@~0.18.7 [email protected] @expo/webpack-config@^0.17.0 # (these are required dependecies)
npm run web
Ideally, you will have Android and web running, maybe iOS also. If you have any problems, ask teacher or co-student for help.
Task:
- Implement at least 1 element (for example Text or Button from your Figma design).
- Upload code for Expo project + Link to Figma to Github
- Send the teacher's email the link to Github project
- Your blog has posts. Post has title, text, created_at and picture. Posts are listed so that the latest is first to be seen (ordered by creation date).
- On Index Page you will see list of Blog Posts. In list, only title and summary is shown.
- When you click on Blog Post on Index Page, you will see all text of Blog Post.
- Ideally, there is possibility to comment also.
- If you want to use Icons, you can use https://www.figma.com/community/file/1135544811622139774
- To get additional visual resources, you can search them from https://www.figma.com/community and https://www.figma.com/community/search?resource_type=mixed&sort_by=popular&query=buttons&editor_type=all (what Chart and Maps you can find and reusein Figma community?)
As a result, you should have designed 2 views in Figma (blog posts lists and details view).
Start from understanding how React Native components work:
- Read everything from Tutorials section (https://docs.expo.dev/tutorial/planning/)
- Read how to use SVG from React Native (https://docs.expo.dev/ui-programming/using-svgs/)
- Check different UI libraries supported by React Native (https://docs.expo.dev/guides/userinterface/)
Check this first: https://reactnative.dev/docs/components-and-apis#basic-components
Your initial code looks like this
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Let's make a new component called BlogPostPreview, that has 3 arguments: title, content and image.
Important links to read:
- https://reactnative.dev/docs/view and function component)
- https://reactnative.dev/docs/image
const BlogPostPreview = ({title, content, imageUrl}) => {
return (
<View>
<Text style={{fontSize: "2em"}}>{title}</Text>
<Text>{content}</Text>
<Image
style={{width: 100, height: 100}}
source={{
uri: imageUrl
}}
/>
</View>
);
};
Try will you get this code to work so that first blog posts previews are listed on the screen?
Hints:
- You need to add last code section into existing code.
- You need to call it from your code.
- You need to add imports.
PLEASE TRY ON YOUR OWN TO GET IT TO WORK!
.. .. .. .. .. ..
Final code should look something similar to this.
import { StyleSheet, Text, View, Image} from 'react-native';
const BlogPostPreview = ({title, content, imageUrl}) => {
return (
<View>
<Text style={{fontSize: "2em"}}>{title}</Text>
<Text>{content}</Text>
<Image
style={{width: 100, height: 100}}
source={{
uri: imageUrl
}}
/>
</View>
);
};
export default function App() {
return (
<View style={styles.container}>
<BlogPostPreview
title="My first post"
content="This is short text of the post"
imageUrl="https://github.com/mxrguspxrt/mobile/raw/main/cat1.jpeg"
/>
<BlogPostPreview
title="My second post"
content="This is short text of the post"
imageUrl="https://github.com/mxrguspxrt/mobile/raw/main/cat2.jpeg"
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
- Align posts to the left.
- Add header to your site (with Blog name)
- Cat images come from my Github - upload your custom images to your Github account. How could you upload images to your project without uploading them to internet? (Assets folder + check this manual https://reactnative.dev/docs/images). You should rename imageUrl to just image and use
image={require("./assets/cat2.jpeg")}
as prop to your component.