Images "missing" in emulator, after build - android

I have built an Android App, using a jQuery Mobile index.html file "wrapped" inside Java using the Android SDK on Eclipse.
However, although the images appear OK within the Dreamweaver "Live" view for jQuery mobile,
they don't appear in the emulator in Android SDK after successful build.
I have added the image files within an image folder in the RES/mpdi folder of the project, and within the index.html file they are referenced as images/"...png" etc
Should I have changed the path in any way in the index.html file?
Also, they are 290x381 pixels - should I have had a different size for the AVD?
Thanks in advance!
David

I will assume you are using something like phonegap
phonegap has a whitelist that tells the app which URLs it's allowed to access. You can also add a * to it, as described http://www.anujgakhar.com/2011/11/22/phonegap-gotcha-error-whitelist-rejection/ found in in the /res/xml/phonegap.xml file

Related

Is there a way to tell what technology was used to build an Android app?

I have an Android App I downloaded and installed, I have also extracted the APK,
Is there some way from the apk file to tell what programming language was used to write the program?
Are there any tools are available to help with this?
What languages can be determined and which ones cannot?
Normally most android app is build using the following texhnologies:---
React Native app
Cordova app
Native java/kotlin app
To determine the technology, you need to decompile the app first using this link
Then look for "assets" folder. Normally, asset folder should be present at the very top of application hierarchy.
Then you can determine the app technology by the following prediction:--
If asset folder is present and there have any file with the extension ".bundle"(mainly the file name is "index.android.bundle") then the app is build using React Native.
If the assets folder contain a folder name "www" and "assets/www" contain the following file/folder structure then it is a cordova app.
If neighter 1 or 2 is true then the app may be written using native code, i.e using java/kotlin
You can do a reverse engineering : (https://www.apkdecompilers.com/ or http://www.javadecompilers.com/apk) decompile the apk and see the code and its programming language.
Not an accurate way to get the specific technology, but through adb, you could check the activity name of an app.
Usually when you open different activities or pages, with native technology the ActivityName will be different like below (Playstore app):
whereas in hybrid apps such as Ionic e.g, it is usually bundled up into one, hence the only activity will be MainActivity... like the Hamilton app made with flutter:

Cntrl + click not working in Android studio

I am new to Android Studio.I like the IDE very much,it has got some nice set of features and has a rich look and feel, however I have some issues with the IDE. I recently created a Cordova application in android studio.I created an HTML file called index.html under assests/www folder.I included my jquery-1.11.3.min.js inside index.html file.I have the habit of checking whether the file jquery-1.11.3.min.js has been correctly included inside HTML file.In eclipse I use cntrl +click to check whether the js file path given is right.But when I use the same thing in Android studio,even if the path is right,it is showing like 'Cannot find declaration to go to'.The screenshot for the same is given below.
Can anyone suggest a solution for this situation.

Access internal files after built - Cordova

I am wondering if is possible accessing the internal files of an app after build with cordova plugin.
My project is based on Android and here are my files:
index.html
html:
- remove.html
js
css
So, after build the app, I want to access with some option within the app the remove.html and remove it.
I find that the FILE plugin of cordova is useful for files inside the device but not the app.
Please anyone has any idea?
we do not have modification access to the location where apk's internal files are saved. Since your remove.html is part of your app apk, we cannot just remove it.
You can take the same approach taken by sqlite raw database file. When your app is started or run for the very first time, copy your file (remove.html) to data folder where you can modify/delete it. Make sure your app only uses this new path everywhere.
Take a look at copyDatabaseFromAssets function in this code for a sample on how do this. Since you will have modification access, you can delete or modify this file as needed.

Porting Phonegap Android asset into Phonegap Windows

I have developed android app using phonegap. Now I want to develop same app for windows phone.
I have downloaded windows sdk in my windows 7 and did the require setup to create cordova app. After that I created sample app. To run my android asset code , just copying its files into www folder is enough...?
Or
What more I need to do for getting this to be worked ...?
Guide me on this to proceed further.
Best thing to do is to try it and see what happens!
But yes, you just need to copy the contents of the www folder of the Android app to the www folder of a new Windows Phone PhoneGap project.
You might find you might have to make minor modifications to things like CSS because of the differences in how the mobile browsers render the web pages (since the Android app will run on a webkit browser frame whilst the Windows app will run on an Internet Explorer browser frame).
You might need to set the 'Build Action' property for any image resources you copy across to the Windows Phone using Visual Studio to get the images to render.
Yes copy the files but be careful not to overwrite existing files. The Cordova.js file is platform specific, as are other .js files that are created in the new project.
You also need to 'include in project' in Visual Studio otherwise the files copied to www are ignored. Do this in the solution browser on the right pane in VS.
Remember the browser is IE as compared with WebKit in Android so some CSS, HTML and Javascript may need to be changed. If you have used a propagation stop to prevent scrolling in WebKit, this may not work in IE and the touch event model is completely different. This MS guide might help:
http://blogs.windows.com/windows_phone/b/wpdev/archive/2012/11/15/adapting-your-webkit-optimized-site-for-internet-explorer-10.aspx

Phonegap Android to other devices

If I build a Phonegap Android app, how do I deploy it to an iPhone and Blackberry? Is it as simple as clicking a button or do I need the Phone and Blackberry SDKs and have to move the webview files manually?
You don't need to rewrite the app another time, you just install the iOS SDK and create a new project then add the .jar files of Phonegap. Then you copy and paste your app files (the HTML, Javascript and CSS files to the new project which you built).
It is simple indeed. But not as simple as that of clicking a button !
If you have developed it for android you will have an www directory which contains your index.html files with your js and images etc.
For android you would have used a js ( cordova.js / phonegap-android.js /similar ) through which you can access your android device specific things ( like buttons, camera, gps, etc ) .
If you are developing the same app for Blackberry , you need to replace the cordova.js with the same for blackberry ( which you can download from phonegap website )
And you need to setup a few things. It is pretty easy. See this link
And for iOs , you need a mac machine as only through Xcode you can develop.

Categories

Resources