我有一个响应的WP博客,我转换成了一个使用cordova的应用程序。 (并添加了一些额外的功能)。
我的想法是提示使用移动设备的用户安装应用程序,如果他在移动浏览器中运行该网站而不是他的应用程序。
类似的东西:
if (isMobile() && !isApplication()) {
var download = prompt('Would you like to install the application instead ?');
....
}
也许WP中已存在这样的插件?
答案 0 :(得分:0)
我使用cordova-plugin-device将此归档为WP:
checkSystemMemory();
%% TODO Virtual memory; enable virtual memory on HDDs.
% http://askubuntu.com/q/799834/25388
home=char(java.lang.System.getProperty('user.home')); % all systems
if (isempty(userpath))
userpath(fullfile(home, 'Documents/bin/matlab/') )
% list software locations in the project location
addpath(fullfile(home, 'Documents/Math/') )
% list software locations in the centralised location
addpath(fullfile(home, 'Documents/Programming/Matlab/export_fig-master/') )
% http://stackoverflow.com/a/38188945/54964
if ( not( com.mathworks.services.Prefs.getStringPref('CurrentKeyBindingSet') == 'Windows' ) )
com.mathworks.services.Prefs.setStringPref('CurrentKeyBindingSet', 'WindowsDefaultSet.xml')
end
% Event errors else with touchpad scroll
!synclient HorizTwoFingerScroll=0
%savepath '/home/masi/pathdef.m'
savepath(fullfile(home, 'startup.m'));
end
function checkSystemMemory()
%% Java for rdsamp - restart for the change to take effect if necessary.
% https://physionet.org/physiotools/matlab/wfdb-app-matlab/faq.shtml
% http://se.mathworks.com/matlabcentral/answers/92813-how-do-i-increase-the-heap-space-for-the-java-vm-in-matlab-6-0-r12-and-later-versions
% http://stackoverflow.com/a/35971040/54964
isSetHeapSizeMemoryMax = com.mathworks.services.Prefs.getIntegerPref('JavaMemHeapMax'); % MB
if (isSetHeapSizeMemoryMax < 2000)
com.mathworks.services.Prefs.setIntegerPref('JavaMemHeapMax', 2048); % MB
fprintf('Quitting Matlab Function because memory %d is insufficient.', ...
isSetHeapSizeMemoryMax);
return
end
assert(java.lang.Runtime.getRuntime.maxMemory/1e9 >= 1.9, 'Java heap size too small');
end