Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS build #1124

Open
wants to merge 170 commits into
base: trunk
Choose a base branch
from
Open

iOS build #1124

wants to merge 170 commits into from

Conversation

OLFDB
Copy link
Contributor

@OLFDB OLFDB commented May 29, 2021

This PR is to get a working iOS build.
Tested on iPhone 6 Plus, iPhone 8 with iOS 14.6. Fullscreen is not working yet, but app is fully usable.
Tested with iPad2 and iPhone 4S for armv7 architecture using SDK 10.3. Fullscreen working, but resizing issues when rotating.
Issue with speech rate (too fast).
Tested with simulator

Pan/pinch/tap is supported.

New Xcode buildsystem is now supported.

The method to draw text needed to be changed from CGContextShowTextAtPoint to drawAtPoint to have UTF-8 characters being displayed. Before the Cyrillic and Greek keyboard were not usable at all. Unfortunately I have not been able to figure out how to apply the transformation to this kind of drawing text. I have opened a question on stackoverflow.com on that.

Currently all labels are drawn horizontally on the map. In favor of having a fully functional keyboard, I decided to keep the current solution until there is an answer.

Speech is using either HFP, or A2DP. When playing background music on the phone it uses A2DP, when no background music is playing it uses HFP, assuming that the user is listening to some other audio source on the radio. This will allow navigation announcements to mute the radio playback and being heard.

There is a new attribute for navit.xml that can be used to force HFP to be used always, or never:

Always use HFP:
<speech type="iphone" speech_use_hfp="1">

Never use HFP:
<speech type="iphone" speech_use_hfp="0">

How to build
Have Xcode installed (tested with 12.5).
clone repo

cd navit
mkdir build
cd build

As HFP needs time to setup the connection and this is highly depending on the used hardware there is a new attribute to configure the delay in ms in the speech tag in navit.xml

speech_hfp_delay

The graphics support scaling of images now.

Background processing is now supported with very low CPU load. Routing announcements are spoken as usual.

CMake Commands
iOS with current SDK

cmake -G Xcode ../ -DCMAKE_TOOLCHAIN_FILE=../Toolchain/xcode-iphone_new.cmake -DUSE_PLUGINS=0 -DBUILD_MAPTOOL=0 -DSAMPLE_MAP=0 -DXSLTS=iphone -DUSE_UIKIT=1 -DDEVELOPMENT_TEAM_ID="<enter your team id>" -DCODE_SIGN_IDENTITY="iPhone Developer" 

iOS9.2 with SDK 10.3
For older devices with arm7 (e.g. iPad2) download https://download.developer.apple.com/Developer_Tools/Xcode_8.3.3/Xcode_8.3.3.xip

Unzip the file and provide the path to Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer in the cmake command line as CMAKE_IOS_DEVELOPER_ROOT.

cmake -G Xcode ../ -DCMAKE_TOOLCHAIN_FILE=../Toolchain/xcode-iphone_new.cmake -DUSE_PLUGINS=0 -DBUILD_MAPTOOL=0 -DSAMPLE_MAP=0 -DXSLTS=iphone -DUSE_UIKIT=1 -DDEVELOPMENT_TEAM_ID="<enter your team id>" -DCODE_SIGN_IDENTITY="iPhone Developer" -DCMAKE_IOS_DEVELOPER_ROOT="/Volumes/Data/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer" -IOS_ARCH="armv7" -DIPHONEOS_DEPLOYMENT_TARGET="9.2" 

Simulator

cmake -G Xcode ../ -DCMAKE_TOOLCHAIN_FILE=../Toolchain/xcode-iphone_new.cmake -DUSE_PLUGINS=0 -DBUILD_MAPTOOL=0 -DSAMPLE_MAP=0 -DXSLTS=iphone -DUSE_UIKIT=1 -DDEVELOPMENT_TEAM_ID="<enter your team id>" -DCODE_SIGN_IDENTITY="iPhone Developer" -DIOS_PLATFORM=SIMULATOR 

Open navit.xcodeproj in build directory with Xcode.
Build in Xcode.

navitiOS.mov

OLFDB added 30 commits June 27, 2021 07:31
…0 lines, image resizing, debug output levels to debug, call navit_destroy on exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants