Google Map Title annotation not working for Android in Rhodes - rhodes

I have create Map view in my application, every thing works fine
except the title annotation
my rhodes version is 3.0.2
Here is my code
#customer = User.find(#params["id"])
map_params = {
:settings => {:map_type => "hybrid",:region =>
[#customer.lat, #customer.lag, 0.2, 0.2],
:zoom_enabled => true,:scroll_enabled =>
true,:shows_user_location => false,
:api_key => 'Google Maps API Key'},
:annotations => [{
:latitude => #customer.lat,
:longitude => #customer.lag,
:title => "#{#customer.name}",
:subtitle => "View customer",
:url => "/app/User/
{#{#customer.object}}"
}]
}
MapView.create map_params
while googling i found title annotations is not yet implemented in
Android, is there any other alternative way to do it?
In my application i have to do like this......
[Screen Image][1]
Is it possible?

There are currently no alternatives for Android. They have a few development items on their radar, however:
Implement MapView Annotations
Change Pin Icon
Multi-line Annotations

Download the master branch of Rhodes Source code and you will see the annotations on Android.
To do this, follow these instructions:
Clone the master branch to your pc (you can also see these instructions):
$ git clone git://github.com/rhomobile/rhodes.git
$ cd rhodes
Modify your RHO_HOME variable
Add the bin path to your path (evironment variable)
(Recommended: reboot your computer)
Add the file rhobuild.yml to the new Rhodes folder
Run
set-rhodes-sdk
(you should see the new Rhodes folder/path here if you did everything correctly)
Run
rhodes-setup
and follow the instructions
Run a clean build of your application
I hope this helps you out. This solved my problems with annotations.

Related

RN 0.56 throws error 'React/RCTBridgeModule.h' file not found

Long story short, I got very very old RN IOS project (dependency list can show you how old) which works on only one company macbook. Thing is that this macbook has already some problems and I wished to install everything on my current mac, Unfortunately it throws many errors and I don't really know what to do with them. Project works on previous mac with XCode 12.5, I installed same version here just to make sure, also node v8.17.0 is used in previous mac so I used nvm to get same version.
Package.json
dependencies": {
"react": "^16.4.1",
"react-dom": "^16.4.2",
"react-native": "0.56",
"react-native-axios": "^0.17.1",
"react-native-barcode-builder": "^1.0.5",
"react-native-ble-manager": "^6.5.1",
"react-native-bluetooth-status": "^1.3.0",
"react-native-canvas": "^0.1.23",
"react-native-color-matrix-image-filters": "^5.2.0",
"react-native-cookies": "^3.3.0",
"react-native-linear-gradient": "^2.4.2",
"react-native-pulse": "^1.0.6",
"react-native-restart": "0.0.7",
"react-native-safari-view": "^2.1.0",
"react-native-side-menu": "^1.1.3",
"react-native-splash-screen": "^3.1.1",
"react-native-vector-icons": "^5.0.0"
},
So i go clone, np install and then npx react-native start, try to launch it in XCode and then build fails with:
'React/RCTBridgeModule.h' file not found in several libraries. As far as I can see in "Build Phases" > "Link binary with Libraries" they are there
EDIT
Ok I tried to take approach signed as a answer from link in comments, it went a bit further but now it crash on:
Showing Recent Messages
Build input file cannot be found: '../node_modules/react-native/third-party/glog-0.3.4/src/vlog_is_on.cc'
Showing Recent Messages
Build input file cannot be found: '../node_modules/react-native/third-party/glog-0.3.4/src/utilities.cc'
Showing Recent Messages
Build input file cannot be found: '../node_modules/react-native/third-party/glog-0.3.4/src/logging.cc'
Showing Recent Messages
Build input file cannot be found: '../node_modules/react-native/third-party/glog-0.3.4/src/symbolize.cc'
I managed to make it works! Thanks for comment it really helped me to move first step which was the hardest, so basically what I had to do, maybe it will be useful for someone who tries to launch some old project:
In XCode goes to Build Phases, manually unlink all external libraries and then re-add them again
Move React.xcodeproj from libraries to root folder and then in Build Phases => dependency > add React
Goes with the link from comment and disable "Parallelize Build"
Proceed with this link in case of glog error => https://github.com/facebook/react-native/issues/14382 (here I a bit messed up with several answers but moreless I did this yarn cache clean rm -rf node_modules yarn install and then this => https://github.com/facebook/react-native/issues/14382#issuecomment-405472763 and https://github.com/facebook/react-native/issues/14382#issuecomment-422755411)
Then in case of RCTBridge error I go with this answer => https://github.com/facebook/react-native/issues/31412#issuecomment-872032401
And in the end when app was succesfuly build but crash on launch I went with Solution number 2 from this link => https://blog.cpming.top/p/rn-error-unknown-argument-type-attribute-in-method

Android deploy with fastlane image playstore order

In android fastlane there is a directory
fastlane/metadata/android/en-US/images/phoneScreenshots
Inside that directory I see a number of images:
1_en-US.jpeg
2_en-US.jpeg
3_en-US.jpeg
When I go to the Google Playstore I see the images show up in order based on the numbering of the jpegs. I want to update those images manually as I got some new images. I want to confirm that the image order that appears in Google play is defined by the numbering of the image? ie, 1_en-Us.jpeg will appear before 2_en-Us.jpeg and so on?
A follow up question is if I now manually change the images and I want to do a new deploy is there anything else that needs to be in the deploy lane? Currently I just have:
desc "Deploy a new version to the Google Play"
lane :deploy do
# gradle(task: "clean assembleRelease")
gradle(task: 'clean')
gradle(task: 'assemble',
build_type: 'Release',
properties: {
"android.injected.signing.store.file" => "/somewhere",
"android.injected.signing.store.password" => "something",
"android.injected.signing.key.alias" => "something",
"android.injected.signing.key.password" => "something",
}
)
upload_to_play_store
end

how to bundle flutter ffi plugin

I am writing uber h3 plugin for flutter. I have working source code but I have problems with creating package more precisely I have problems to bundle libh3.so
Quick overview:
there is uber h3 c source code which is downloaded by. download_deps.sh
then android/build.gradle has build commands
externalNativeBuild {
cmake {
path "../ios/CMakeLists.txt"
}
}
then example/lib/main.dart has some initialization code.
initializeH3((String name) => Platform.isAndroid
? DynamicLibrary.open("lib${name}.so")
: DynamicLibrary.process());
but when I try to build it library file can not be found.
-I tried different locations.
It seems that library native .so is not bundled into application
But I don't konw why
According to tutorial https://flutter.dev/docs/development/platform-integration/c-interop
it should be bundled.
Here is the source code https://github.com/fmatuszewski/h3
I have managed to get this running, the pubspec.yaml was incorrectly formatted and required:
flutter:
plugin:
platforms:
android:
package: com.example.h3
pluginClass: H3Plugin
ios:
pluginClass: H3Plugin
Adding in at the end.
In doing this the package was properly attached.
libh3.so needs to be added into android/src/main/jniLibs to naturally be attached however I also moved the code:
final DynamicLibrary h3 = Platform.isAndroid
? DynamicLibrary.open("libh3.so")
: DynamicLibrary.process();
Back into h3.dart and removed main.dart to get this to run.
I think these were the main issues to get the code running. I had issues working out what was wrong as I am new to plugins - so it was a long process to sit and work out all the ins and outs. In doing this I ended up reworking all of the code to understand what was going on. If none of these points work or you wants eyes on the working code let me know and I can upload it to Github.

How to specify output .apk file path when using fastlane gradle?

I have different product flavors of my app and I build them with fastlane. This is my fastfile:
default_platform(:android)
platform :android do
desc "Release apk with different urls"
lane :release do
gradle(
task: "assemble",
build_type: "release",
flavor: "flavorname",
print_command: true,
properties: {
"android.injected.signing.store.file" => "Key.jks",
"android.injected.signing.store.password" => "KeyPass",
"android.injected.signing.key.alias" => "KeyAlias",
"android.injected.signing.key.password" => "KeyPass"
}
)
end
end
The problem is apk files are created in project directory.
(projectname/app/build/outputs/apk/flavorname/release/app-flavorname-release.apk)
How to move this apk files to my Desktop automatically?
I use the following under my gradle call:
lane :release do
gradle(...)
APK_LOCATION = "#{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]}"
sh("mv #{APK_LOCATION} ~/Desktop/")
end
The advantage of using the variable is that you will be able to use the same code for release and debug apk.
Cheers.
It doesn't seem that gradle has an option to specify the output.
What I suggest you is to add a command line just after the gradle is done to move this .apk to the Desktop or wherever you want.
sh "mv ../app/build/outputs/apk/release/app-release.apk path/to/Desktop"
You can also use fastlane action copy_artifacts instead of mv
lane :release do
gradle(...)
copy_artifacts(
artifacts: ['*/build/outputs/apk/**/*.apk'],
target_path: '~/Desktop/'
)
end
Wilcard */build/outputs/apk/**/*.apk will work with any build types, flavors app module name.
Or as said #janpio above, you can use variable GRADLE_APK_OUTPUT_PATH:
lane :release do
gradle(...)
copy_artifacts(
artifacts: [lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]],
target_path: '~/Desktop/'
)
end

how to import javax.swing in android studio

I have just setup Android Studio and started a simple application. Well started is an over statement, I got stuck on first few lines and am unable to import JFrame into android studio.
I have the latest SDK installed aling with LibGDX. I am still not able to setup JFrame. I have searched the net/youtube and no solutions have been found.
I can see the javax and swing in my external libraries but just cannot import.
Any ideas what I am doing wrong or not doing?
I am not looking for a "how to tutorial", I just a pointer where I should go hunting for the answer.
wow, not huge amount of response.
Please advise if I have asked a stupid question or difficult question.
public hungryDog() {
JFrame jframe = new JFrame();
Timer timer = new Timer(20, this);
renderer = new Renderer();
rand = new Random();
jframe.add(renderer);
jframe.setTitle("Hungry Dog");
jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jframe.setSize(WIDTH, HEIGHT);
jframe.addMouseListener(this);
jframe.addKeyListener(this);
jframe.setResizable(false);
jframe.setVisible(true);
dog = new Rectangle(WIDTH / 2 - 10, HEIGHT / 2 - 10, 20, 20);
columns = new ArrayList<Rectangle>();
addColumn(true);
addColumn(true);
addColumn(true);
addColumn(true);
timer.start();
}
You can't use Swing on Android. Android has its own UI framework which is different, and Swing isn't supported. To see what Java APIs are supported on Android look at the API docs at http://developer.android.com/reference/packages.html
I used to have the same problem; here's how to solve it.
You see, we were trying to use swing lib in a totally wrong context, that is, within an Android app. As Scott Barta pointed out, Android has its own mechanisms for doing what we wanted to achieve and that's why IntelliJ didn't let us import anything that would interfere with Android API.
Hence, do NOT use Android app when, say, simply learning how to code in Java or, on a more advanced level, when testing/debugging your algorithms. Instead, build a standalone Java program (yes, in Android Studio). This very topic is covered here: Can Android Studio be used to run standard Java projects? , "Tested on Android Studio 0.8.6 - 1.0.2" by idunnololz). A few clarifying remarks to this solution:
1) wnen preparing your configuration (Run | Edit Configurations...), use your new Java module name and its main class in the appropriate fields.
2) before clicking Run make sure you selected same configuration.
Incidentally, there indeed IS a way to import swing library into any Android app: based on http://www.youtube.com/watch?v=fHEvI_G6UtI. Specifically, add a new line to build.gradle file for your Module:app:
compile files ('<path_to_your_jdk's_rt.jar>')
Like this:
compile files ('C:/Program Files/Java/jdk1.8.0_31/jre/lib/rt.jar')
Note single quotes and forward slashes. Then click Sync Gradle icon and enjoy the view.
In our particular case, however, the program won't run. The code itself will be clean, there'll be no errors; with swing lib well in place and connected, IntelliJ won't suspect a thing; the project WILL compile... but then we'll get a runtime error. Now your know why. On the other hand, this method works like magic when we do not interfere with Android API --- which we shouldn't in the first place.
That's all there is to it.
Yes you can. As addition to Igor's answer here are the steps:
Create new Android Studio project: File -> New -> New Project -> Phone and Tablet -> Add No Activity, select Java (not Kotlin) as language obviously.
Add new Java module: File -> New -> New Module -> Java Library
Remove Android module: File -> Project Structure -> Modules -> app, click - button.
NOTE: step 5 is probably not needed. Try without it first.
Edit build.gradle of your java module, and add in dependencies implementation fileTree pointing to the JRE you need.
Example of build.gradle:
apply plugin: 'java-library'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree ('/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/jre/lib/rt.jar')
}
sourceCompatibility = "6"
targetCompatibility = "6"
Now code completion works and you can even run the app:
Click on Add Configuration: near run button
Click on + -> Application
Select your Main Class
At Use classpath of module: select your java module there (not project's)