android


Can not access com.codename1.impl.android.AndroidNativeUtil From nativeInterface


Can not access com.codename1.impl.android.AndroidNativeUtil From nativeInterface in codenameone as this structure is not available in the CodenameOne.jar.
Do I need to import any other jar in classpath? Need to access the activity of codenameOne from the native interface by the below code:
private static Activity activity() {
return com.codename1.impl.android.AndroidNativeUtil.getActivity();
}
But I am getting this error while deploying:
Compiling with JDK Java compiler API.
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/mycompany/myapp/MyNativeImpl.java:46: error: cannot find symbol
private static Activity activity() {
^
symbol: class Activity
location: class MyNativeImpl
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/codename1/impl/android/AndroidImplementation.java:4684: error: cannot find symbol
if (android.support.v4.content.ContextCompat.checkSelfPermission(activity,
^
symbol: method checkSelfPermission(CodenameOneActivity,String)
location: class ContextCompat
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/codename1/impl/android/AndroidImplementation.java:7117: error: cannot find symbol
if (android.support.v4.content.ContextCompat.checkSelfPermission(activity,
^
symbol: method checkSelfPermission(CodenameOneActivity,String)
location: class ContextCompat
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/codename1/impl/android/AndroidImplementation.java:7122: error: cannot find symbol
if (!forceAsk && android.support.v4.app.ActivityCompat.shouldShowRequestPermissionRationale(activity,
^
symbol: method shouldShowRequestPermissionRationale(CodenameOneActivity,String)
location: class ActivityCompat
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/codename1/impl/android/AndroidImplementation.java:7135: error: cannot find symbol
android.support.v4.app.ActivityCompat.requestPermissions(activity,
^
symbol: method requestPermissions(CodenameOneActivity,String[],int)
location: class ActivityCompat
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/codename1/impl/android/AndroidImplementation.java:7152: error: cannot find symbol
return android.support.v4.content.ContextCompat.checkSelfPermission(activity,
^
symbol: method checkSelfPermission(CodenameOneActivity,String)
location: class ContextCompat
/tmp/build313004297852547361xxx/MyApplication/src/main/java/com/mycompany/myapp/MyNativeImpl.java:56: error: no suitable constructor found for Intent(MyNativeImpl,Class)
Intent intent = new Intent(this,
^
constructor Intent.Intent(String,Uri) is not applicable
(argument mismatch; MyNativeImpl cannot be converted to String)
constructor Intent.Intent(Context,Class) is not applicable
(argument mismatch; MyNativeImpl cannot be converted to Context)
Notice that it will mark it as inaccessible in the IDE but when you send the builds to the servers it should work just fine.
This is mentioned in the native interfaces tutorial.

Related Links

How to implement a changelog in android?
How to get the speaking sound that comes from the phone user and convert to byte array ?
How can i change image at run time ?
Can multiple lists be treated as fragments in Android?
Code does not extend ListViewActivity, but does have a listview
Calling a EditText field into focus
MOBAC cannot generate the required file name for osmdroid
viewflipper flipping
Java:How to use two different logging systems depending on running environment
how to combine photo and image in one?
Overriding internal GPS Android for use with Navigation
Android ICS 4.0 Placing Flash WebView into full screen calls hideAll Method?
ClickableSpan not… Clicking [duplicate]
Is it possible to create an Android app to change the outgoing greeting for voicemail to an mp3 file?
Android SQLite retrieving data from the database and displaying that data in text
Android can i write layout xml file programmaticlly and load it with setContentView(R.layout.test_1) function?

Categories

HOME
sonarqube
cobalt
prism
cheerio
merge
phpmyadmin
twig
3d
yahoo-finance
serialization
mstest
pdfbox
nfs
syntaxnet
enthought
mautic
radgridview
package-managers
mathprog
asp.net-core-webapi
asciidoctor-pdf
squashfs
spring-async
r-mice
visual-studio-extensions
event-store
jackson-modules
handler
datastax-enterprise-graph
browser-sync
failover
gitlab-api
complex-numbers
left-join
kodi
wacom
installshield-le
numpy-broadcasting
engine.io
typesafe-config
unordered-map
levenshtein-distance
microsoft-metro
facebook-social-plugins
plan-9
vaadin-elements
flask-restful
opennms
twilio-click-to-call
singleinstance
rackspace-cloud
cmp
jtree
swingworker
juice-ui
gets
custom-lists
dotnetnuke-7
nikeplus-api
ng-grid
gogs
qiime
riot
turbo-prolog
createprocess
fuzzywuzzy
ellucian-scribe
exim4
spring-retry
rate-limiting
toolkit
vacuum
botan
zxspectrum
ejb-2.x
mutual-authentication
git-repo
mysql-error-1044
ie8-compatibility-mode
breakout
beaker-testing
poker
traceability
virtual-pc
mkv
fragmenttransaction
failing-tests
entity-attribute-value
automationelement
rmdir
socketserver
cruisecontrol.rb
office-2007
dot-emacs
duplex
web-application-project
sun
perl5.12
appliance
netbeans6.1
idatareader

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App