I've been struggling to make tab icons show up on an actual Android device in a tab based application. It looks like icons cannot be found and all I can see is the tab text. Everything shows up fine though when running the app on the Android emulator. Has anybody had a similar problem and can give some valuable input? This issue happens only in actual Android devices, iOS works fine.
Dependencies used:
react-native : 0.49.5
react-native-navigation : 1.1.270
Code:
Navigation.startTabBasedApp({
tabs: [
{
label: 'Booking',
screen: 'LocationsForm',
icon : require('./src/assets/imgs/tabs/booking.png'),
title: 'Booking'
},
{
label: 'Account',
screen: 'AuthSplash',
icon : require('./src/assets/imgs/tabs/user.png'),
title: 'Account'
},
{
label: 'More',
screen: 'Extras',
icon : require('./src/assets/imgs/tabs/more.png'),
title: 'More'
}
]
});
UPDATE
For people that have the same problem. I could not find a way to make it work on an actual Android device when I was installing the debug.apk. The problem seems to solve itself though when you install the release.apk. So, all you have to do is assemble the production release of your app, install it, and you should be able to see the tab icons appearing fine on your Android device.
Related
I am building a kivy based Android app. At the moment when I run the app on Linux the MDToolbar shows the menu icon without a problem. But when I build the app for Android with menu icon dosent show up. The lambda function works even if the icon is not presented.
Here is an image that shows the problem.
This is the kv code.
MDToolbar:
id: mainToolbar
title: "APP name"
left_action_items: [['menu', lambda x: navDrawer.set_state("open")]]
Any ideas why is this happening?
I've been able to fix this by upgrading Kivy to version 2.0.0.
I am trying to have Chrome launch without the "Welcome to Chrome" screen and can't seem to figure out the correct way to do so using Selenoid with the provided Android Docker images.
I used the automate_android.sh to create the container image and followed all the prompts, deviating from the default only when asked for version numbers and when it asked if I wanted to install Chrome.
Chrome will load but regardless of what I put in my test, I can't seem to get it to bypass the welcome screen.
Currently my config looks like this:
const merge = require('deepmerge');
const wdioConf = require('./wdio.conf.js');
exports.config = merge(wdioConf.config, {
capabilities: [
{
version: '8.1',
browserName: 'android',
chromedriverArgs: {
args: [ '--disable-fre', '--no-default-browser-check', '--no-first-run' ],
},
"selenoid:options" :
{
skin: "WVGA854",
enableVNC: true,
enableLog: true
}
}
]
}, {clone: false});
I have tried changing chromedriverArgs to "goog:chromeOptions" and chromeOptions. Ive tried moving all three combinations inside the "selenoid:options" as well.
I suspect I am just doing something wrong but would appreciate any assist anyone can provide.
Versions
Selenoid: 1.9.1
Android: 8.1 and 8.0
WebdriverIO: 5.4.19
Docker: 18.09.2, build 6247962
You have to use chrome as browserName. This is how Appium works.
I've searched about this around ionic forums, stackoverflow, etc., but I still haven't found an answer.
I'm creating an ionic 4 app with an inappbrowser inside and I want it to be like a part of the app with the bottom tabs showing.
Others suggested to use iframe but I'm not sure if that's good since they're also saying that it has issues uploading to the apple app store.
My folder structure:
Tabs Folder
Page 1 Folder (Where the inappbrowser is located)
Page 2 Folder (This page shows with the tabs and has no problem)
Here's the code in the page 1 folder:
this.platform.ready().then(() => {
const browser = this.iab.create(url, '_blank', {location:'no',
footer:'no', zoom:'no', usewkwebview:'yes', toolbar:'no'});
});
and Here's the routes of the tab folder:
const routes: Routes = [{
path: 'tabs',
component: TabsPage,
children: [
{
path: 'page1',
children: [
{
path: '',
loadChildren: '../page1/page1.module#page1Module'
}
]
}
I understand that inAppBrowser covers all the parts of the app and has the absolute position, so the solution I'm thinking is to just set a height for the inAppBrowser so that it will not cover the bottom tabs, but is that possible?
Update: I used React Native instead.
As React Native webview is not in a different layer, and can be inserted on any part of the app.
I have created a new Ionic app and setup the cordova local notifications plugin to have notifications run in the background without the need for an external server such as Google Cloud Messaging using this plugin.
https://github.com/katzer/cordova-plugin-local-notifications
Everything seems to work but for some reason the icon shown in the notification isn't the one that I am setting in the js below - can anyone suggest what is wrong - it does show an icon, (an alarm bell) but it isn't the one that have I specified.
// within my $ionicPlatform.ready
$scope.scheduleSingleNotification = function () {
$cordovaLocalNotification.schedule({
id: 1,
title: 'Warning',
text: 'My first local notification this will stick!',
icon: '../img/github-icon.png'
}).then(function (result) {
console.log('Notification #1 triggered');
});
};
I had same problem few months back but than i have given a hit and trial an it worked for
create the icons of all sizes and copy them to /platforms/android/res/
and respective folders of sizes i hope that will solve problem
An always give the path of img respect to your index file not the file in which your are coding but to the main file in which it's included
Make sure that the icon has a white or transparent background. If you take a look at the documentation:
Android notifications
icons should only be a white-on-transparent background image.
I'm using ionic to build an android app. I'm using
$cordovaLocalNotification for local notifications. The notification works but it shows a default bell icon. How can I customize the notification icon?
$scope.scheduleSingleNotification = function () {
$cordovaLocalNotification.schedule({
id: 1,
title: 'GRM APP Builder',
text: 'Quer café?!?',
badge: 1,
icon: 'res://coffee.png',
data: {
customProperty: 'custom value 1'
}
}).then(function (result) {
console.log('Notification 1 triggered');
});
};
After spend hours with this question, I saw that one comment above it's really right.
If you want to change icon, you need to create a folder called "drawable" in "[my ionic app folder]\platforms\android\res\drawable".
But the trick is: after this you need to quit your livereload mode and execute again CLI command "ionic run android -l -c -s". It's necessary because you need to copy new assets to device.
I only tested with Android device, if you can test with iOS please send a review here.
According to this post on the forum, you can simply set the notification's icon and smallIcon properties. You have to put the files into /platforms/android/res/drawable/ folder. (also mind that the icon has to be started with 'res://somename')
Note: You shall replace ngCordova's notification handling functions, since they are faulty.
In the latest ionic-cli 3,
Copy your icon.png into the following folder.
platforms/android/res/drawable/icon.png
Note that this is in android only.
Once this is done( make sure that the image is a transparent icon),
next step is to initialize this icon in the notification.init function.
Now if we you are using push plugin
do the following;
const pushObj: PushObject = this.push.init({
android: {
senderID: "your_id",
icon: "icon",
forceShow: "true"
},
ios: {
alert: "true",
badge: "true",
sound: "true"
}
});
As you can see that the Only the name of the icon is added not the extenstion.
Once this is done, include a same key value pair in the server side code as well, which pushes the notification into your device.
All will be working well.